Skip to main content

Not getting consent page for Authorization Code Grant sample, trying with console sample java application. getting com.docusign.click.client.ApiException: Error while requesting server, received a non successful HTTP code 400 with response Body: '{"error":"consent_required"}'

@21Deepti

The error message means that you did not give consent before. This needs to be done in a web browser once to allow the integration key or the app that uses it, to access your user account.

This is Step 1 in this guide on how to set up Authorization Code Grant.
Please follow the instructions there and you should be able to use it.


Thanks! for quick reply.

 

When I executed sample JWT-console application got from Quickstart, consent grant page opened and was able to grant that and got access token successfully. Then I created one more app key and configured that in same sample application, but consent grant page didn’t opened for that so got {"error":"consent_required"}.                           

Then I constructed consent URL as mentioned at guide you shared and triggered at browser to provide consent. I got access token successfully. 

I have integrated Click API in my application and used test account to fetch agreements. Now when we go to production deployment and configure production account there, is consent grant step has to be done manually like I did?


@21Deepti 

Yes, you will need to to it again in production, as this is a different environment and there is no connection between the demo and the production environments. You can also add the integration key to “Trusted Apps” if you are having an organisation set up. This is changing it from user consent to app consent for the account.


Reply