Take the following steps when you want to acquire an API token for a Project Insight user without asking the user for their user name or password.
1. Create a DeviceActivationRequest object with the following properties:
- ClientPlatform
- The platform or operating system the activation request was made by (optional). For example, Windows 10, iOS 9
- ClientDevice
- The device or computer type the activation request was made by (optional), for example Computer, iPhone, Droid
- ClientAgent
- The device user agent string, for example Safari, Chrome, Edge
- Required when making a device activation request
- ClientIPAddress
- The client declared IP address the activation was made from (optional)
- ClientHostName [Host Name]
- The host name of the computer or device which requested the activation (optional)
2. Post the DeviceActivationRequest object to:
POST /device-activation/create-request
- This endpoint returns a DeviceActivationRequestPending object with the following properties:
- DeviceActivationId
- DeviceActivationRequestUrl
- ExpirationDateTimeUTC
3. Direct the user the URL provided by the DeviceActivationRequestUrl property of the DeviceActivationRequestPending object
- Once logged in the user will be provided an activation code to be used in the next step
4. Get a DeviceActivationRequestComplete object using the following endpoint:
GET /device-activation/complete-request?activationRequestId={activationRequestId}&activationCode={activationCode}&clientAgent={clientAgent}&timeoutMinutes={timeoutMinutes}
- activationRequestId
- The device activation request ID
- activationCode
- User activation code for the device activation that was provided to the user when they visited the DeviceActivationRequestPending.DeviceActivationRequestUrl
- clientAgent
- The user agent requesting the device
- Must match the device sent in the original request
- timeoutMinutes - time out of the device in minutes
- Null equals one year
- This endpoint returns a DeviceActivationRequestComplete object with the following properties:
- ApiToken
- DeviceId
- UserId
- ApiTokenExpirationDateTimeUTC
5. Use the ApiToken value for making future calls to the web api
Comments
0 comments
Please sign in to leave a comment.