Create a device-agent auth code
curl --request POST \
--url https://api.trycomp.ai/v1/device-agent/auth-code \
--header 'Content-Type: application/json' \
--data '
{
"consent_token": "5d2e8f1a3b4c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
consent_token: '5d2e8f1a3b4c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e'
})
};
fetch('https://api.trycomp.ai/v1/device-agent/auth-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/device-agent/auth-code"
payload = { "consent_token": "5d2e8f1a3b4c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Device Agent
Create a device-agent auth code | Comp AI API
Create a single-use device-agent auth code for a sign-in the user confirmed. Requires a consent token from POST /v1/device-agent/auth-consent.
POST
/
v1
/
device-agent
/
auth-code
Create a device-agent auth code
curl --request POST \
--url https://api.trycomp.ai/v1/device-agent/auth-code \
--header 'Content-Type: application/json' \
--data '
{
"consent_token": "5d2e8f1a3b4c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
consent_token: '5d2e8f1a3b4c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e'
})
};
fetch('https://api.trycomp.ai/v1/device-agent/auth-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/device-agent/auth-code"
payload = { "consent_token": "5d2e8f1a3b4c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Body
application/json
Single-use token from POST /v1/device-agent/auth-consent, issued when the signed-in user confirmed the device sign-in
Example:
"5d2e8f1a3b4c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e"
Response
201
Was this page helpful?

