REST API Endpoints
Creates a token to be used with initConnection() functions in the Terra mobile SDKs in order to create a user record for Apple Health or Samsung Health (or equivalent)
Your API key for authentication
Your developer ID for authentication and tracking
200
success250c68b9c21b78e40e7a3285a2d538d3bc24aabd3b4c76a782fb0a571ca4501d0Example: 180A referenced resource does not exist on Terra's end.
POST /api/v2/auth/generateAuthToken HTTP/1.1
Host: access.tryterra.co
x-api-key: YOUR_API_KEY
dev-id: YOUR_API_KEY
Accept: */*
{
"status": "success",
"token": "250c68b9c21b78e40e7a3285a2d538d3bc24aabd3b4c76a782fb0a571ca4501d",
"expires_in": 180
}Generates a single-use token for a developer (consumer) connection.
Your API key for authentication
Your developer ID for authentication and tracking
Token generated.
Single-use token to present in the IDENTIFY frame.
cG9RvLY5.yvKm778XMIPm1ig93BJEoRCVGHzlrBNjzWdeXePTaMMMissing or malformed authentication headers.
Invalid developer credentials.
Token generation failed.
POST /auth/developer HTTP/1.1
Host: ws.tryterra.co
x-api-key: YOUR_API_KEY
dev-id: YOUR_API_KEY
Accept: */*
{
"token": "cG9RvLY5.yvKm778XMIPm1ig93BJEoRCVGHzlrBNjzWdeXePTaMM"
}Generates a single-use token for a user (producer) connection. The id
identifies the user the token is scoped to — a v6 connection id or a v5
compatibility user UUID — and must belong to the authenticating
developer.
Your API key for authentication
Your developer ID for authentication and tracking
The id of the user to generate a token for.
Token generated.
Single-use token to present in the IDENTIFY frame.
OTYwNWFi5ZWQMTAxMjg0Y2Qw.gzrPzZcS3Gy8QDOxbiPRwu30PTB3VxW0eEMissing id parameter, or missing/malformed authentication headers.
Invalid credentials, or the user does not belong to this developer.
Token generation failed.
POST /auth/user?id=text HTTP/1.1
Host: ws.tryterra.co
x-api-key: YOUR_API_KEY
dev-id: YOUR_API_KEY
Accept: */*
{
"token": "OTYwNWFi5ZWQMTAxMjg0Y2Qw.gzrPzZcS3Gy8QDOxbiPRwu30PTB3VxW0eE"
}Last updated
Was this helpful?