nielf
(nielf)
1
Hi,
I am testing the eFront API, specifically the [Add User to Curriculum](Build, Collaborate & Integrate APIs | SwaggerHub
I can use other ut_Curriculum__Id__AddUser).
When I am using x-www-form-urlencoded in Postman, my request is successful.
However, when I change the body to raw it is not working:
Am I doing something wrong or missing something?
I am using the API with the raw format to create a new user where it works as expected (screenshot from Power Automate).
w4dd325
(w4dd325)
3
Hi @nielf
It looks like you are hitting two separate end-points… a PUT and a POST.
A quick glance over the Swagger docs looks like the PUT’s only accept x-www-form-urlencoded body’s
Where as the POST’s appear to accept both that and application/json body’s
nielf
(nielf)
4
I see. Thanks for the input @w4dd325
However, I am still struggling with the part where I have to ender the UserId in the body.
I have added a header with key: Content-type and Value: application/x-www.form-urlencoded
Then I have tried this in the body:
UserId=35
userid=35
{
“UserId”: 35
}
also tried adding it as a parameter in the URL:
My end goal is to use it in a Power Automate action, where I cannot enter Key/Value pairs directly, as I can in postman.
w4dd325
(w4dd325)
5
Looks like you need to pass an ‘id’ param…
I see you have ‘13’ hardcoded, add it as a param and ensure that the number is correct.
nielf
(nielf)
6
@w4dd325 the ID I have hardcoded is the Curriculum ID.
What I am struggling with is how to add the UserID in the body.
w4dd325
(w4dd325)
7
When you import the cURL command from Swagger into Postman, it looks like this:
You can grab the cURL like this:
And then just import it directly into Postman and it will configure the call for you.
nielf
(nielf)
8
It works fine for me in Postman.
However, the issue is, that I need to convert that into something I can use in an HTTP action Power Automate.
Here I can’t enter the Key/Value pairs as I can in Postman.
w4dd325
(w4dd325)
9
Looks like you need to copy out the multi-part form data, try this article:
nielf
(nielf)
10
Thanks for the link, @w4dd325.
I’ll see if I can use that approach.
nielf
(nielf)
11
I finally found a solution that works.
It is described in the second part of this blog.