Tokens
Tokens
Contentstack provides different types of tokens to authorize API requests.
deliveryTokens
You can use Delivery Tokens to authenticate Content Delivery API (CDA) requests and retrieve the published content of an environment.
| Name | Type | Description |
|---|---|---|
| tokenUid | String | The UID of the token that you want to retrieve. |
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
DeliveryToken deliveryToken = contentstack.stack();
Call<ResponseBody> response = deliveryToken.deliveryTokens("tokenUid").execute();
if (response.isSuccessful) {
System.out.println("Response" + response);
}managementToken
To authenticate Content Management API (CMA) requests over your stack content, you can use Management Tokens.
| Name | Type | Description |
|---|---|---|
| managementTokenUid | String | The managementTokenUid. |
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
ManagementToken managementToken = contentstack.stack();
Call<ResponseBody> response = managementToken.managementToken("managementTokenUid").execute();
if (response.isSuccessful) {
System.out.println("Response" + response);
}