• Register

OAuth2.0

Some of Venchi APIs use Oauth2.0 protocol authorization with Client Credentials grant. This means that to successfully invoke an API you need to supply a valid authorization token as header parameter. To obtain a token you need to supply the **client_id** (your key) and **client_secret** assigned to your Application, which you should have received via e-mail. Refer to the _**Register your Application**_ section for instructions on how to do so. ## API Console Click on the _**Authorize**_ button. ![authorizeButton](/files/authorizeButton.PNG) Fill both fields with your key and secret then, again, click on the _**Authorize**_ button. ![authorizeTab](/files/authorizeTab.PNG) Now just click on _Close_. ![authorizeOK](/files/authorizeOK.PNG) A token has now been assigned to you and will automatically be included in every API call until you navigate away from the page. ### cURL Example Here, we provide an example of a cURL to obtain a valid token
curl --location --request POST 'https://api.venchi.com/dev/masterdata/v1/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=dfja5taaaaa6chbbbcdca2j2' \
--data-urlencode 'client_secret=f2AkaWNQvb' \
--data-urlencode 'grant_type=client_credentials'