Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

octopart search not working #40

Open
flashfingaz opened this issue Jan 22, 2021 · 2 comments
Open

octopart search not working #40

flashfingaz opened this issue Jan 22, 2021 · 2 comments

Comments

@flashfingaz
Copy link

fresh install, added octopart api key and got error 500 when trying to fetch data (everything else works fine):

[2021-01-22 20:56:35] request.CRITICAL: Uncaught PHP Exception Guzzle\Http\Exception\ClientErrorResponseException: "Client error response [status code] 401 [reason phrase] Unauthorized [url] http://octopart.com/api/v3/parts/search?apikey=[MY-API-KEY-LIVES-HERE]&q=esp32&start=0&include%5B0%5D=short_description&include%5B1%5D=specs&include%5B2%5D=datasheets&limit=20" at /var/www/html/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php line 43 {"exception":"[object] (Guzzle\Http\Exception\ClientErrorResponseException(code: 0): Client error response\n[status code] 401\n[reason phrase] Unauthorized\n[url] http://octopart.com/api/v3/parts/search?apikey=XXXXXXXXXXXXXX&q=esp32&start=0&include%5B0%5D=short_description&include%5B1%5D=specs&include%5B2%5D=datasheets&limit=20 at /var/www/html/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43)"} []

turns out that:

  1. partkeepr release used by your docker image uses api v3
  2. octopart is not issuing v3 api keys anymore
  3. v4 api integration has been merged into master already: Octopart v4 API partkeepr/PartKeepr#1150

in conclusion everyone that has not yet got an api key will not be able to use octoparts with the docker image

so my suggestion would be to build the docker image against git, or at least create a variant that would do so. would make me very happy :)

@twilkie12
Copy link

For a short term fix, go into:
"src/PartKeepr/OctoPartBundle/Services/OctoPartService.php" and change the "/v3/" to "/v4/rest".

This will allow you to use your v4 api key.

@jumper385
Copy link

do you do this using the interactive shell on docker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants