Terra Docs
Dashboard
  • Docs
  • API Reference
  • Changelog
  • Health & Fitness API
    • REST API Endpoints
    • Supported integrations
    • Event Types
    • Data models
    • Samples
    • Core concepts
    • Destinations
    • Mobile SDK
      • iOS (Swift)
      • Android (Kotlin)
      • React Native
      • Flutter
  • Streaming API
    • REST API Endpoints
    • Supported Integrations
    • Core Concepts
    • Websocket Reference
    • Mobile SDK
      • iOS (Swift)
      • Android (Kotlin)
      • Flutter
      • React Native
  • Teams API - Beta
    • Supported Integrations
    • Core Concepts
    • API Endpoints
    • Event types
Powered by GitBook
On this page

Was this helpful?

  1. Streaming API

REST API Endpoints

PreviousFlutterNextSupported Integrations

Was this helpful?

Stream - Generate user token

post

Endpoint for generation of a token for a user (producer) connection

Authorizations
Query parameters
idstringOptional

The ID of the user to generate a token for

Header parameters
dev-idstringRequired

your developer ID

x-api-keystringRequired

your API key

Responses
200
Successful response
application/json
403
Forbidden
text/plain
post
POST /auth/user HTTP/1.1
Host: ws.tryterra.co
x-api-key: text
dev-id: text
Accept: */*
{
  "token": "OTYwNWFi5ZWQMTAxMjg0Y2Qw.gzrPzZcS3Gy8QDOxbiPRwu30PTB3VxW0eE"
}

Stream - Generate developer token

post

Endpoint for generation of a token for a developer (consumer) connection

Authorizations
Header parameters
dev-idstringRequired

your developer ID

x-api-keystringRequired

your API key

Responses
200
Successful response
application/json
403
Forbidden
text/plain
post
POST /auth/developer HTTP/1.1
Host: ws.tryterra.co
x-api-key: text
dev-id: text
Accept: */*
{
  "token": "cG9RvLY5.yvKm778XMIPm1ig93BJEoRCVGHzlrBNjzWdeXePTaMM"
}

Generates an authentication token for the Terra mobile SDKs

post

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)

Header parameters
dev-idstringRequired

your developer ID

Example: testingTerra
x-api-keystringRequired

your API key

Example: OtHJok60oQmT8zhnUWc4SWBJI7ztPTs88C0gOsJJ
Responses
200
200
application/json
404
404
application/json
post
POST /v2/auth/generateAuthToken HTTP/1.1
Host: api.tryterra.co
dev-id: text
x-api-key: text
Accept: */*
{
    "status": "success",
    "token": "250c68b9c21b78e40e7a3285a2d538d3bc24aabd3b4c76a782fb0a571ca4501d",
    "expires_in": 180
}
  • POSTGenerates an authentication token for the Terra mobile SDKs
  • POSTStream - Generate developer token
  • POSTStream - Generate user token