Home > Forum > Plugins > REST API -

REST API -
0

Hi,

I try to use this article, but it does not works anymore.

https://kb.webcon.pl/przyklady-uzycia-rest-api/

I try to generate a token base on this instruction https://developer.webcon.com/docs/2024.1/api-registration-and-authentication#get-access-token
in Postman to api/oauth2/token , example:

{
"grant_type": "client_credentials",
"client_id": "XXX",
"client_secret": "XXX",
"scope": "HighTrust.Elements.ReadWrite.XXX
}

I recived error:

{
"error": "invalid_request"
}

In reply to: Daniel Krüger (Cosmo Consult)

Hi,

if you get an invalid request response, the error is the body. In your case a double quote is missing at the end of the scope.

You can also omit the scope completely.

Best regards,
Daniel

Hi,

I added double quote, but still the same error in Postman.

{
"grant_type": "client_credentials",
"client_id": "XXX",
"client_secret": "XXX",
"scope": "HighTrust.Elements.ReadWrite.XXX"
}

I recived error:

{
"error": "invalid_request"
}

The solution was to use swagerr, enter a value in :

grant_type *
client_id *
client_secret *

I recived correct curl syntax, and import to Postman.

Best regards,
Tomasz

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings