waveapps api showing invalid grant error

samyaksamyak Member Posts: 3

Hi waveapps team,
recently we are trying to create an invoice with an option to select previous products/services stored in waveapps. with being said, we would need to fetch products/services from waveapps. it working perfectly new users but for old users waveapps user it throws invalid_grant error. is this happening due to not adding proper scopes while connecting with waveapps?

Comments

  • KieronBKieronB Member Posts: 13 admin

    Hi @samyak ,

    That error message sounds like it's related to OAuth. Can you give a little more detail about the steps to reproduce the problem?
    You can read more about the OAuth Flow here

  • samyaksamyak Member Posts: 3

    currently on our application, we had added waveapps in order to create an invoice.
    Based on OAuth guide provided, we have followed them and connected our application with the waveapps that would enable to create invoices from our applications.
    as scopes for connecting to waveapps, we have added "account:* business:read customer:* invoice:* product:* user:read" which seems correct but additional scopes might have been added later on by the previous developer who worked with integrating waveapps with our application,

    at the moment, we were going add new feature that would fetch products/services created on user's waveapps account and add that products/service as line item while creating invoice.

    so for previous/old users from our application who had already been connected to waveapps, when i try to fetch products/services from user's waveapps i get the "invalid grant" error. so my question is it because of not required scopes provided while connecting to waveapps in case of old user, as for new users it works perfectly for new users.

  • KieronBKieronB Member Posts: 13 admin

    Hi @samyak ,

    If you could PM me the Wave Application Client ID, I may be able to look into this for you. You can find the Client ID on the Manage Applications page of the Developer Portal (you'll need to be signed into Wave with the associated account).

  • KieronBKieronB Member Posts: 13 admin

    Hi @samyak ,
    The invalid_grant error can occur when a POST to /oauth2/token/ contains invalid parameters. eg, the code parameter, which can only be used one time, after which a new code must be obtained.

    You mentioned that this issue is occurring for old users. Is it possible that your code is trying to generate a new token (after the previous one has expired), but it is sending the original code value? This will always return a 401 response with an invalid_grant error.

Sign In or Register to comment.