Token refresh
Renew a DAM connection token, and what to do when a provider has no refresh.
A DAM connection token from the login poll eventually expires. Some providers renew it without sending the user back through the browser; others require a fresh login instead. The request is the same across providers, so your code is too.
The pattern
Handle every provider the same way: try to refresh, and fall back to a fresh DAM login when the refresh fails. A 404 means the provider has no refresh path, so treat it (and any other failure) as the signal to log in again. Some providers (Dropbox is one) return only a new access_token; when refresh_token is absent, keep the prior one and reuse it on the next refresh. One code path covers them all.
Endpoint
GET /auth/refreshToken is shared with the CI HUB session refresh; the token in provider-authorization decides which session is renewed. Send the DAM refresh_token from the login poll to renew a DAM connection, then send the new access_token as provider-authorization on subsequent content calls.
Authorization
CIHubAuth ProviderAuth The CI-HUB JWT token obtained through authentication. Needs to be sent in the Authorization header.
In: header
Provider-specific authentication token for accessing the provider's services. Needs to be sent in the provider-authorization header with the Bearer prefix.
In: header
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/auth/refreshToken"{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"token_type": "Bearer"
}{
"message": "Error",
"details": "POST /api/v1/auth/exchangeToken failed: SDK authentication token is invalid",
"errorCode": "cihub-sdk-token-invalid",
"error": {
"code": "integration-forbidden",
"source": "cihub",
"status": 400,
"message": "Access denied by the integration",
"details": "403 Forbidden - insufficient_permissions",
"provider": "bynder"
}
}{
"message": "Error",
"details": "POST /api/v1/auth/exchangeToken failed: SDK authentication token is invalid",
"errorCode": "cihub-sdk-token-invalid",
"error": {
"code": "integration-forbidden",
"source": "cihub",
"status": 400,
"message": "Access denied by the integration",
"details": "403 Forbidden - insufficient_permissions",
"provider": "bynder"
}
}{
"message": "Error",
"details": "POST /api/v1/auth/exchangeToken failed: SDK authentication token is invalid",
"errorCode": "cihub-sdk-token-invalid",
"error": {
"code": "integration-forbidden",
"source": "cihub",
"status": 400,
"message": "Access denied by the integration",
"details": "403 Forbidden - insufficient_permissions",
"provider": "bynder"
}
}{
"message": "Error",
"details": "POST /api/v1/auth/exchangeToken failed: SDK authentication token is invalid",
"errorCode": "cihub-sdk-token-invalid",
"error": {
"code": "integration-forbidden",
"source": "cihub",
"status": 400,
"message": "Access denied by the integration",
"details": "403 Forbidden - insufficient_permissions",
"provider": "bynder"
}
}