3.3 KiB
3.3 KiB
Get an access token
This page explains how to get an access token, this token needs to be sent along when sending requests to the REST API.
Please follow the steps below
- Go to the swagger documentation: https://farmmaps.awacc.nl/swagger/index.html
- Click "Authorize" and check the "Scopes" checkbox, click authorize again.
- You will now be redirected to the FarmMaps OpenID login form, enter your details (akkerweb account, acceptation or test) and login.
- Once logged in, you will automatically be redirected back to swagger again.
- Close the "Available authorizations" popup.
- Expand one of the items listed, for example "CodeListItem".
- Click "Try it Out" and then "Execute"
- Under "Responses" the curl command lists the access token after
-H "Authorization: Bearer
:
curl -X GET "https://farmmaps.awacc.nl/api/v1/codelistitems" -H "accept: application/json" -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkNERkM3M0I0NzY0Q0M5RTYxQTVDRjg3OEM5MDlFRUU0ODFFODk5MzEiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJ6Znh6dEhaTXllWWFYUGg0eVFudTVJSG9tVEUifQ.eyJuYmYiOjE1ODcxMzE4ODMsImV4cCI6MTU4NzEzNTQ4MywiaXNzIjoiaHR0cHM6Ly9hY2NvdW50cy5mYXJtbWFwcy5hd2FjYy5ubCIsImF1ZCI6ImFwaSIsImNsaWVudF9pZCI6ImZhcm1tYXBzYWNjX3N3YWdnZXIiLCJzdWIiOiJtYWlsdG86YXVrZUBzaW1wZWx3ZWJkZXNpZ24ubmwiLCJhdXRoX3RpbWUiOjE1ODcxMzE4ODIsImlkcCI6ImxvY2FsIiwic2NvcGUiOlsiYXBpIl0sImFtciI6WyJwd2QiXX0.HOnc6ohPFljzPRXMpDnDMXlmlYCb5SBrNB3OMrpjAGx_TSES-ZJ8QuOwyeVLEn4LG0USkMzKZpR4MGAZvkN-5CgLu2unFWHjVBU_tY16QBg7pOnd-ZdXbMojINFk05EIFXEL2vBMWV1i3pxQVFK3jb7ybt_Lkw-X-2PwkcwaJk72aNY05pBswhyEr1PqSlVc5jOZuJzdzB6q17FRkCvxtIGmM-aSQpCozMdwD1CTu7Z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