RequestAuthentication*

This API endpoint requires authentication to be used.

The RequestAuthentication endpoint returns a URL to give to a user to authenticate with your application using Donut Team.

Endpoint

https://api.donutteam.com/RequestAuthentication.json

Arguments

As with the rest of the API, arguments are passed as part of the URI separated by forward slashes.

https://api.donutteam.com/{Endpoint}/{APIKey}

Endpoint (Required)

All valid:

  • RequestAuthentication.xml
  • RequestAuthentication.json

APIKey (Required)

Your application's API key.

Handling the response

Successful response

A successful response will return the following values:

Code This code is a temporary key that will be used to query if a user has authenticated with your app. You should re-query this code using CheckAuthenticateToken every 20 seconds while waiting for authentication. This code will expire after 15 minutes if it is not authenticated within that time.
Link The link you should open in the user's browser to allow authentication. This link will expire after 15 minutes if it is not authenticated within that time.

Error response

ErrorCode
An error code used for internal development purposes. Endpoint separated by two colons and then an incriminating number. This should be used when you want to handle the error yourself.
ErrorText
Error text to explain what is happening.

Errors

RequestAuthentication::1
RequestAuthentication::3
No API Public Key provided.
RequestAuthentication::2
Provided public key was not found.
We were unable to find your application's API in our database. You may have a mistake in the key you gave us.
RequestAuthentication::4
API does not have permission for request authentication.
Your application does not have the permission to request authentication.
RequestAuthentication::5
API understood your request but was unable to fulfill it.
An error occurred on our end that was irrecoverable.

Example response

XML

GET https://api.donutteam.com/RequestAuthentication.xml/ZOS8csheS8csheFqkLVFS8qkLVQDDudZK
<DonutTeam>
	<Code>tzes7_V56p2hq-OjrR3Ym1X9BLmMhkdBkTVV8C4Uco_nGw-mtVKRgQjwxHHRQnVc</Code>
	<Link>https://donutteam.com/authoriseApp/ZOS8csheS8csheFqkLVFS8qkLVQDDudZK/tzes7_V56p2hq-OjrR3Ym1X9BLmMhkdBkTVV8C4Uco_nGw-mtVKRgQjwxHHRQnVc/1549811688</Link>
</DonutTeam>

JSON

GET https://api.donutteam.com/RequestAuthentication.json/ZOS8csheS8csheFqkLVFS8qkLVQDDudZK
{
    "Code": "3jXkcOOejTlgF-QgYFmxiqiVZOq3ReYeAAPgJODwYMNzk7i35TI3caziCE7f0Uz8",
    "Link": "https:\/\/donutteam.com\/authoriseApp\/ZOS8csheFqkLVQDDudZK\/3jXkcOOejTlgF-QgYFmxiqiVZOq3ReYeAAPgJODwYMNzk7i35TI3caziCE7f0Uz8\/1549811728"
}
Back to top