Skip to content

401 error on batch_product_details #36

Description

@hruhland-mtm

I'm attempting to use the batch product details API like this (is there documentation on how you are supposed to do this? I'm basing it off the keyword_search example):

from digikey.v3.batchproductdetails import BatchProductDetailsRequest

...

batch_request = BatchProductDetailsRequest(products=['MMSZ5231B-FDICT-ND', 'BZX84C5V6-FDICT-ND'])
parts = digikey.batch_product_details(body=batch_request)

This results in the following error:

ApiException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Date': 'Fri, 03 Feb 2023 19:35:18 GMT', 'Content-Type': 'application/json', 'Content-Length': '228', 'Connection': 'keep-alive', 'Access-Control-Allow-Origin': '', 'Access-Control-Allow-Headers': 'origin, x-requested-with, accept, content-type, authorization,x-digikey-client-id, x-digikey-locale-site, x-digikey-locale-language, x-digikey-locale-currency, x-digikey-locale-shiptocountry, x-digikey-customer-id', 'Access-Control-Max-Age': '3628800', 'Access-Control-Allow-Methods': 'POST', 'X-DIGIKEY-REQUEST-ID': '5d4263b6-648e-4996-811e-f03373f8d46d', 'Set-Cookie': '[hiding cookie string for security]; Path=/; Secure; HTTPOnly'})
HTTP response body: {"ErrorResponseVersion":"3.0.0.0","StatusCode": 401,"ErrorMessage":"Invalid Client-Id","ErrorDetails":"X-DIGIKEY-Client-Id invalid for requested resource","RequestId":"5d4263b6-648e-4996-811e-f03373f8d46d","ValidationErrors":[]}

I can successfully use keyword_search and product_details so it seems like my client ID must be correct. Is there some other API permissions I need to enable on my digikey account?

Edit: Perhaps this is related? https://forum.digikey.com/t/x-digikey-client-id-invalid-for-requested-resource/26675

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions