Skip to main content

OAuth Token

Public API v1 supports a client credentials style token exchange.

POST /public/v1/oauth/token

Request

Content-Type:

  • application/x-www-form-urlencoded

Required form fields:

  • grant_type=client_credentials

Credentials:

  • Either HTTP Basic auth (client_id:client_secret)
  • Or include client_id and client_secret as form fields

Example (Basic auth):

curl -sS \
-X POST \
-u "$FIELDKIT_CLIENT_ID:$FIELDKIT_CLIENT_SECRET" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
"https://api.fieldkit.cc/public/v1/oauth/token"

Example (form fields):

curl -sS \
-X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$FIELDKIT_CLIENT_ID" \
-d "client_secret=$FIELDKIT_CLIENT_SECRET" \
"https://api.fieldkit.cc/public/v1/oauth/token"

Response

{
"access_token": "papi_...",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "products:read quotes:read"
}

Using The Token

curl -sS \
-H "Authorization: Bearer $FIELDKIT_ACCESS_TOKEN" \
"https://api.fieldkit.cc/public/v1/products"