Not able to convert x-www-form-urlencoded (Postman) to WebApi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-12-20 12:24 PM
In Postman, the keys are in Body as x-www-form-urlencoded.
Converted to CURL (it looks like this):
In BP Web api \ Request\ Body content \ Template, I have tried both format 'key1=[value1]'&'key2=[value2]' and JSON format like { "key1": "[value1]", "key2": "[value2]"} (Content-Type= application/x-www-form-urlencoded and application/json).
Both elternatives return HTTP 400 error (which is syntax error, I quess).
------------------------------
Ruben Gjelsten
Senior Analyst Service Management
SSV IIC RPA
Europe/London
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
03-12-20 02:14 PM
You can add the parameters in the URL path like https://xxxx/?key1=[value1]&key2=[value2] with Body Content set to None.
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-03-21 09:22 PM
------------------------------
Jenna Jentges
Financial Analyst
CUNA Mutual Group
America/Chicago
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-03-21 10:25 PM
grant_type=[Grant Type]&client_id=[Consumer Key]&client_secret=[Consumer Secret]&username=[Username]&password=[Password]
Cheers,
------------------------------
Eric Wilson
Director, Partner Integrations for Digital Exchange
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-03-21 11:54 AM
As well as what Eric has mentioned you should also make sure that the header is set in either each action or in the API service such as below.
Hope this helps
------------------------------
Ronan Considine
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-02-22 10:52 AM
I am facing an interesting issue with a POST to get the access token to interact with Sharepoint list. The call is currently working in Postman but not in BP webservices.
The error I am getting is as follows:
--------------------------------------------------
HTTP Status Code: 400
HTTP Response Content: {"error":"invalid_request","error_description":"AADSTS900144: The request body must contain the following parameter: 'grant_type'.......
-------------------------------------------------
The URL I am using is = https://accounts.accesscontrol.windows.net/[TID]/tokens/OAuth/2
Body (Template):
{
"grant_type": "client_credentials",
"client_id": "[XXXXX]",
"client_secret": "[XXXXX]",
"resource": "00000003-0000-0ff1-ce00-000000000000/[XXXXX.com]@[XXXXX]"
}
Header:
Every time I run this it fails with the error above but it works perfectly in postman. Are you in a good position to support me with this?
------------------------------
Kapeteni Polutea
Technical Consultant
EY
Australia/Sydney
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-02-22 11:01 AM
The body template should be in this format
grant_type=[client_credentials]&client_id=[XXXXX]&client_secret=[XXXXX]&resource=00000003-0000-0ff1-ce00-000000000000/[XXXXX.com]@[XXXXX]
------------------------------
Shashank Kumar
DX Integrations Partner Consultant
Blue Prism
Singapore
+6581326707
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-02-22 11:11 AM
www form urlencoded uses a slightly different language which Postman converts between however BluePrism does not.
What you will need to do it to convert your body from JSON into this new format as Shashank has detailed. Postman allows you to select between JSON and raw text but BluePrism will automatically convert this so you just need to put the text with appropriate values but without quotation marks
------------------------------
Ronan Considine
Business Automation Lead
Blue Prism
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-02-22 11:44 AM
Appreciate this community 🙂
------------------------------
Kapeteni Polutea
Technical Consultant
EY
Australia/Sydney
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-02-22 04:44 PM
I have a similar problem but I cannot solve it with what you have proposed, I have my request in postman and it works as expected:
I am receiving "Internal : Unexpected error Error during Web API HTTP Request
HTTP Status Code: 400
HTTP Response Content: Bad Request"
I am not sure if my problem is related with the Authorization or with the Body itself. Do you know what could be wrong? It would be very helpful if you could give me a hand,
Thank you in advance.
------------------------------
Jesus Jordan
------------------------------
