question

Bcarbs avatar image
Bcarbs asked

Product selection page fails but no error message

Hi there!

So I've gotten to the point where a user can log in, grant access to the DRS app, and is then sent here to select products they'd like to authorize for automatic renewal. Unfortunately this the only info I receive back. Here are some details about the device and slots that have already been configured.

Thanks for the help!

alexa skills kitdash replenishment service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Levon@Amazon avatar image
Levon@Amazon answered

Hi Bcarbs,

It looks like a duplicate of your other post where we already provided an answer: https://forums.developer.amazon.com/questions/46075/the-scope-data-list-you-provided-is-invalid-for-yo.html

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hey Levon,

Unfortunately this is a new one! Actually there are two... First, thanks for your help with my first issue, that was resolved and I can now successfully receive an authorization code for scope dash:replenish. Whenever I try to gain my bearer tokens with my code I receive this error...

{"error_description":"The request has an invalid grant parameter : code","error":"invalid_grant"}

I'm attempting to gather these tokens within the 1-hour time frame that the code is valid and am constructing my request in this manner... (expired code and abbreviated secret)

https://api.amazon.com/auth/o2/token?grant_type=authorization_code&code=ANEZfezOoSgNCUrapNAD&client_id=amzn1.application-oa2-client.1d46c0b931e74813bda81d4e1c776b1c&client_secret=7c92e...a&redirect_uri=https%3A%2F%2Fwww.getpostman.com%2Foauth2%2Fcallback&code_verifier=test

Just to make sure my request is valid I successfully acquired access and refresh tokens for scope=profile utilizing the same app and formulated request like above.

The screenshot above has to do with the authorization grant process and choosing items for replenishment. (drs-web.amazon.com/product_selection) It's operation is intermittent and only seems to work with a few ASINs (even though others are sold and fulfilled by amazon as well).

0 Likes 0 ·
Levon@Amazon avatar image
Levon@Amazon answered

Hi there,

The error in /product_selection is independent of "invalid_grant" error from LWA. Per LWA documentation, "invalid_grant" implies:

"The provided authorization grant (e.g. authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."

Is it possible that code is not being used with the correct redirectURI or client_id?

Regarding the error in the /product_selection, can we get more information for troubleshooting:

  1. Model ID
  2. Timestamp
  3. Serial number

Using different set of ASINs should not be causing this issue.

2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hey Levon! Thanks for taking a closer look at this!

Turns out that including the code_verifier field in my body was causing an issue with being granted access and refresh tokens. When I remove that field everything works as expected. If I understand correctly, that field is really for my own use to authenticate requests that come from my device, so I didn't expect it's presence to halt the token grant, considering the documentation here https://developer.amazon.com/public/solutions/devices/dash-replenishment-service/docs/dash-lwa-web-api

includes it? Anyway, I've been able to initiate test orders now! So things are working. I'm stuck now formulating a working slotStatus request.

https://forums.developer.amazon.com/questions/49865/could-you-show-me-a-properly-formatted-request-bod.html

As for the ASIN's, things have improved greatly in the product selection page since I first started accessing the interface in early Novemeber. Now if an ASIN is not available there are options to skip the product. The failing ASINs were pantry items, which I believe may not be available to the DRS app at this time.

Thanks for the help!

0 Likes 0 ·

Glad it's working for you now, I replied to your other question. Thanks!

0 Likes 0 ·