This page explains how to attach an integration token to your requests and access CMS data with authentication via Integration API.
Issuing an integration token
Section titled “Issuing an integration token”Integration API authenticates using an integration token. First, issue an integration token for the target project (and workspace, if needed) in the Re:Earth CMS management console. See Creating an Integration for the steps.
Retrieve a list of items (GET)
Section titled “Retrieve a list of items (GET)”As a first check, let’s retrieve a list of items with Integration API. Attach your issued integration token to the Authorization header. Replace the angle-bracketed placeholders such as <workspace_id_or_alias> with your actual values.
curl --location --request GET \ 'https://api.cms.reearth.io/api/<workspace_id_or_alias>/projects/<project_id_or_alias>/models/<model_id_or_key>/items' \ --header 'Authorization: Bearer <your_integration_token>'$TOKEN = "<your_integration_token>"$WORKSPACE_ID = "<workspace_id_or_alias>"$PROJECT_ID = "<project_id_or_alias>"$MODEL_ID = "<model_id_or_key>"
$headers = @{ Authorization = "Bearer $TOKEN" Accept = "application/json"}
$uri = "https://api.cms.reearth.io/api/$WORKSPACE_ID/projects/$PROJECT_ID/models/$MODEL_ID/items"$resp = Invoke-RestMethod -Method Get -Uri $uri -Headers $headers$resp