238
Views
5
Comments
Solved
Error API Rest
Question
Hi

I'm currently working on an REST API integration, however, I can not seem to do this in OutSystems. The REST API call I make:

A post with the following structure:

header: content type: application / x-www-form-urlencoded;
body: grant_type: client_credentials;
Basic authentication completed (user and password).
I am having the following error

HTTP / 1.1 400 BadRequest
Content-Type: application / json; charset = UTF-8
Pragma: no-cache
Content-Length: 34
Cache-Control: no-cache
Date: Tue, 09 Oct 2018 16:41:50 GMT
Expires: -1
Server: Microsoft-IIS / 7.5
X-Powered-By: ASP.NET
{
  "error": "unsupported_grant_type"

}

Has anyone had this problem before?

2025-10-29 14-26-01
Daianne Souza
Champion
Solution

Good night the problem was solved by passing the url in the form of a query String.

thank you


UserImage.jpg
Rabelani Tambani

Daianne Caetano Figueredo Souza wrote:

Good night the problem was solved by passing the url in the form of a query String.

thank you


Please Share how you have passed that URL in form of query string 


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Daianne,

I notice in write application / x-www-form-urlencoded rather than application/x-www-form-urlencoded (no spaces before and after the /). Not sure if that causes an issue, i think it should be passed on the call all without spaces.

Are you sure you need grant_type: client_credentials and not grant_type: password ?

Did you try to test your API using a program like Postman, and if does, it give the same error as your OutSystems implementation, or does it then work?

Regards,

Daniel


2025-10-29 14-26-01
Daianne Souza
Champion

 
Both Postman and OutSystems return the same error.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

And did you try grant_type: password ?

If this is a rest API that you consume please check the documentation on how to use it and which grant_types are supported.

With the information you give it is not easy to understand why it shouldn't work.

Regards,

Daniel

2025-10-29 14-26-01
Daianne Souza
Champion
Solution

Good night the problem was solved by passing the url in the form of a query String.

thank you


UserImage.jpg
Rabelani Tambani

Daianne Caetano Figueredo Souza wrote:

Good night the problem was solved by passing the url in the form of a query String.

thank you


Please Share how you have passed that URL in form of query string 


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.