v1/credentials
Use this endpoint to retrieve PubNub credentials to use with the PubNub SDK. Use these credentials to receive Websocket protocol subscription events. Applications should request these credentials just prior to creating the PubNub SDK instance they use. Pass the credentials returned by this endpoint to the PubNub SDK constructor, in the appropriate fields. If you do not pass these credentials into the constructor, the application does not receive the events from PubNub channels properly.
NOTE: Each user will receive a unique cipher key in the response. This user-specific cipher key is used to encrypt and decrypt all events sent to and received on the PubNub channel specified in the user’s subscriptions. User-specific cipher key encryption prevents another user from decrypting a user’s events, even if they share the same PubNub channel name in their subscription. Due to this reason, channel sharing across different users is not recommended.
Resource Information
Method and URI | GET https://developer.api.autodesk.com/fevnt/v1/credentials |
Authentication Context | user context optional |
Required OAuth Scopes | data:read |
Data Format | JSON |
Request
Headers
Authorization* string | Must be Bearer <token> , where <token> is obtained via either a two-legged or three-legged OAuth flow. |
x-request-id string | GUID used by the service team track the request |
region string | Specifies the geographical location (region) of the server that the request is executed on. Default is US. |
collection-id string | Specifies the collection ID being subscribed to. The request will be routed to the region containing the collection. The region header and region query parameter always have precedence over this header. |
locale-container-id string | Specifies the Locale Service container ID. The request is routed to the region specified by this ID. The region header and region query parameter always have precedence over this header. |
Request
Query String Parameters
region string | Specifies the geographical location (region) of the server that the request is executed on. Default is US. The region header also specifies the region. If you specify both, the region header has precedence. |
locale-container-id string | Specifies the Locale Service container ID. The request is routed to the region specified by this ID. The region header and region query parameter always have precedence over this query parameter. |
Response
HTTP Status Code Summary
200 OK | Information to be used when creating an instance of the PubNub SDK. |
401 Unauthorized | Request has not been applied because it lacks valid authentication credentials for the target resource. |
403 Forbidden | Unauthorized |
429 Too Many Requests | User has sent too many requests in a given amount of time. |
500 Internal Server Error | An unexpected error occurred on the server. |
Response
Body Structure (200)
pubNubSubscriptionKey string | The subscription key to use when initializing the PubNub SDK |
pubNubCipherKey string | The cipher key to use when initializing the PubNub SDK |
Example
Information to be used when creating an instance of the PubNub SDK.
Request
curl -v 'https://developer.api.autodesk.com/fevnt/v1/credentials' \
-H 'Authorization: Bearer AuIPTf4KYLTYGVnOHQ0cuolwCW2a'
Response
{
"pubNubSubscriptionKey": "sub-c-example-subscription-key",
"pubNubCipherKey": "example-cipher-key"
}