Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-02-22 03:21 PM
Hi,
I am attempting to connect to BOX application via APIs however am getting this error:
Internal : Unexpected error Failed to get OAuth2.0 Access Token : "Unexpected character encountered while parsing value: <. Path '', line 2, position 1." ""
Is anyone able to advise what may be wrong/how to resolve?
------------------------------
Chloe MacIntosh
Automation Developer
Zurich Insurance
Europe/London
------------------------------
I am attempting to connect to BOX application via APIs however am getting this error:
Internal : Unexpected error Failed to get OAuth2.0 Access Token : "Unexpected character encountered while parsing value: <. Path '', line 2, position 1." ""
Is anyone able to advise what may be wrong/how to resolve?
------------------------------
Chloe MacIntosh
Automation Developer
Zurich Insurance
Europe/London
------------------------------
Answered! Go to Answer.
1 BEST ANSWER
Helpful Answers
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-02-22 11:45 AM
Hi @ChloeMacIntosh,
I think the issue here is that the fields "code" and "grant_type" aren't passed along to the Authorization URI when you set the BluePrism authentication type to OAuth 2.0. The default behavior is to send only the the client_id and client_secret. Also the Authorization URI is different in your BluePrism configuration. However it doesn't matter in this case as it wouldn't work anyways.
I suggest that you set the Authentication to None and Use the "Request Access Token" action (you have already created it) in your Web API to get the access token. Set the Body Template as
code=
I think the issue here is that the fields "code" and "grant_type" aren't passed along to the Authorization URI when you set the BluePrism authentication type to OAuth 2.0. The default behavior is to send only the the client_id and client_secret. Also the Authorization URI is different in your BluePrism configuration. However it doesn't matter in this case as it wouldn't work anyways.
I suggest that you set the Authentication to None and Use the "Request Access Token" action (you have already created it) in your Web API to get the access token. Set the Body Template as
code=
&grant_type=[grant_type]&client_id=[client_id]&client_secret=[client_secret]
Make sure you have set the Header for this action
Content-Type application/x-www-form-urlencoded
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-02-22 04:39 PM
Hi @Chloe MacIntosh,
Its seems if the access token request is invalid, such as the redirect URL didn't match the one used during authorization, then the server needs to return an error response. Error responses are returned with an HTTP 400 status code , with error and error_description parameters.
Please check the token request once there might be some parsing issue or mismatch in path.
Check more on Box API on this reference.
https://developer.box.com/guides/tooling/postman/quick-start/make-api-call/
------------------------------
Shikhar Mishra
RPA Lead
Infosys Pvt Ltd
Pune,India
------------------------------
Its seems if the access token request is invalid, such as the redirect URL didn't match the one used during authorization, then the server needs to return an error response. Error responses are returned with an HTTP 400 status code , with error and error_description parameters.
Please check the token request once there might be some parsing issue or mismatch in path.
Check more on Box API on this reference.
https://developer.box.com/guides/tooling/postman/quick-start/make-api-call/
------------------------------
Shikhar Mishra
RPA Lead
Infosys Pvt Ltd
Pune,India
------------------------------
Shikhar Mishra
RPA Lead
Infosys
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-02-22 10:25 AM
Hi @Chloe MacIntosh,
I tried creating an Box App with Server Auth. Below are the configurations that worked for me to get the access token using POSTMAN.
Reference: https://developer.box.com/guides/authentication/client-credentials
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
I tried creating an Box App with Server Auth. Below are the configurations that worked for me to get the access token using POSTMAN.
Reference: https://developer.box.com/guides/authentication/client-credentials
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-02-22 11:11 AM
Hi @Shikhar Mishra
Thank you for coming back to me. I am able to successfully retrieve Access Token using Postman, however when I have tried to set up in Blue Prism it is throwing the above error message, so I am unsure what has gone wrong as API set up for BOX in Blue Prism seems aligned to Postman inputs. Do you have any experience with this, or guidance you can offer please?
------------------------------
Chloe MacIntosh
Automation Developer
Zurich Insurance
Europe/London
------------------------------
Thank you for coming back to me. I am able to successfully retrieve Access Token using Postman, however when I have tried to set up in Blue Prism it is throwing the above error message, so I am unsure what has gone wrong as API set up for BOX in Blue Prism seems aligned to Postman inputs. Do you have any experience with this, or guidance you can offer please?
------------------------------
Chloe MacIntosh
Automation Developer
Zurich Insurance
Europe/London
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-02-22 11:17 AM
Hi @shashank.kumar280
Thank you for coming back to me. I am able to successfully retrieve Access Token using Postman, however when I have tried to set up in Blue Prism it is throwing the above error message, so I am unsure what has gone wrong as API set up for BOX in Blue Prism seems aligned to Postman inputs. Do you have any experience with this, or guidance you can offer please?
Attached are some snips of the current API set up in Blue Prism, if this provides better insight.
------------------------------
Chloe MacIntosh
Automation Developer
Zurich Insurance
Europe/London
------------------------------
Thank you for coming back to me. I am able to successfully retrieve Access Token using Postman, however when I have tried to set up in Blue Prism it is throwing the above error message, so I am unsure what has gone wrong as API set up for BOX in Blue Prism seems aligned to Postman inputs. Do you have any experience with this, or guidance you can offer please?
Attached are some snips of the current API set up in Blue Prism, if this provides better insight.
------------------------------
Chloe MacIntosh
Automation Developer
Zurich Insurance
Europe/London
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-02-22 11:45 AM
Hi @ChloeMacIntosh,
I think the issue here is that the fields "code" and "grant_type" aren't passed along to the Authorization URI when you set the BluePrism authentication type to OAuth 2.0. The default behavior is to send only the the client_id and client_secret. Also the Authorization URI is different in your BluePrism configuration. However it doesn't matter in this case as it wouldn't work anyways.
I suggest that you set the Authentication to None and Use the "Request Access Token" action (you have already created it) in your Web API to get the access token. Set the Body Template as
code=
I think the issue here is that the fields "code" and "grant_type" aren't passed along to the Authorization URI when you set the BluePrism authentication type to OAuth 2.0. The default behavior is to send only the the client_id and client_secret. Also the Authorization URI is different in your BluePrism configuration. However it doesn't matter in this case as it wouldn't work anyways.
I suggest that you set the Authentication to None and Use the "Request Access Token" action (you have already created it) in your Web API to get the access token. Set the Body Template as
code=
&grant_type=[grant_type]&client_id=[client_id]&client_secret=[client_secret]
Make sure you have set the Header for this action
Content-Type application/x-www-form-urlencoded
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
25-02-22 04:47 PM
Hi Shashank, thank you so kindly for your advice! This has resolved initial issues 🙂
------------------------------
Chloe MacIntosh
Automation Developer
Zurich Insurance
Europe/London
------------------------------
------------------------------
Chloe MacIntosh
Automation Developer
Zurich Insurance
Europe/London
------------------------------