Confirm a device-agent sign-in
curl --request POST \
--url https://api.trycomp.ai/v1/device-agent/auth-consent \
--header 'Content-Type: application/json' \
--data '
{
"callback_port": 54321,
"state": "9f2c1b7a4d3e5f60718293a4b5c6d7e8"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({callback_port: 54321, state: '9f2c1b7a4d3e5f60718293a4b5c6d7e8'})
};
fetch('https://api.trycomp.ai/v1/device-agent/auth-consent', 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-consent"
payload = {
"callback_port": 54321,
"state": "9f2c1b7a4d3e5f60718293a4b5c6d7e8"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Device Agent
Confirm a device-agent sign-in | Comp AI API
Record that the signed-in user confirmed a device-agent sign-in. Returns a single-use consent token for POST /v1/device-agent/auth-code.
POST
/
v1
/
device-agent
/
auth-consent
Confirm a device-agent sign-in
curl --request POST \
--url https://api.trycomp.ai/v1/device-agent/auth-consent \
--header 'Content-Type: application/json' \
--data '
{
"callback_port": 54321,
"state": "9f2c1b7a4d3e5f60718293a4b5c6d7e8"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({callback_port: 54321, state: '9f2c1b7a4d3e5f60718293a4b5c6d7e8'})
};
fetch('https://api.trycomp.ai/v1/device-agent/auth-consent', 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-consent"
payload = {
"callback_port": 54321,
"state": "9f2c1b7a4d3e5f60718293a4b5c6d7e8"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Body
application/json
Localhost port the device agent is listening on to receive the auth callback
Required range:
1 <= x <= 65535Example:
54321
Opaque anti-forgery value generated by the device agent and echoed back on callback
Maximum string length:
128Example:
"9f2c1b7a4d3e5f60718293a4b5c6d7e8"
Response
201
Was this page helpful?

