HTTP request to UiPath's Platform Management API returns, 415

Hello,

I’m following the official API guide: Automation Cloud - Allocate Licenses to a User

I completed all the previous steps, and everything works fine in Postman using a raw body.

However, when I try to use the same setup with the HTTP Request activity, I get a 415 error: “Unsupported media type.”

Here are some screenshots of my configuration:

And this is the body I’m sending:

{"userIds:[“userID”],"userBundleCodes:["CODEA",“CODEB”],“useExternalLicense”:booleanValue}

Note: There is no carriage return or spaces in the body.

I’ve tried many different approaches, but I still can’t get a 200 or 202 response.

Could someone please share any advice or guidance?

1 Like

Hi @AlbPalma

Above one is a POST request and you are trying with PUT which is wrong, try changing to POST and let us know if you still facing issue

Hope this helps you

Regards,
Srini

Hi @AlbPalma

For raw body, try json as body/content type instead of plain text, should work.

Hi, @AlbPalma

Change the UiPath HTTP Request “Request body type” to JSON and set a header Content-Type: application/json, then pass your body as a valid JSON string.

Hello, thanks a lot for your responses!

@Srini84 When I try using POST, I receive a “Forbidden” error.

@sonaliaggarwal47 @arjun.shiroya Thanks to your suggestions, the error changed from 415 to 400, a small step forward :sweat_smile:)

Here are a few screenshots of the setup:

And this is the body I’m sending:: {“userIds:[”{{userID}}“],“userBundleCodes:[”{{codeA}}”,“{{CodeB}}”],“useExternalLicense”:{{booleanAsString}}

I’ve experimented with different formats, with and without headers, but still no luck :frowning:

Hi @AlbPalma

Thanks for the update and the body

I see the issue in the Body, countinue with PUT reqeuest only, but the body has to follow as below post

Hope this helps you

Thanks,
Srini

Thank you! It was solved.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.