A third party application can only access data of an installation after the farmer has given its permission. If the farmer gives permission your application will receive a token that will allow it to authenticate to the Nedap Livestock Connect API. Each time you make an API call you need to present this token as a proof of permission.
For this authorization and authentication process, we make use of the standard OAuth2 authorization protocol. More information about the OAuth2 authorization protocol can be found here.
If you want to request access with more permissions than the default one, you should provide the scopes (the permissions) you want access to. The default scope is 'account', which will be used when no scopes are provided.
A code example that provides more scopes:
-d 'client_secret=b0147b284a' \
-d 'code=aecd3e40cd' \
-d 'grant_type=authorization_code' \
-d 'redirect_uri=https://my_application.com/access_code' \
Successful authorization response:
If you ever wish to revoke a token, this can be done with the following call:
-F client_secret=0d74dkfi3 \
-F token=aecd3e40cd \
-X POST https://nedap-bi.com/oauth/revoke