Tokens

View as Markdown

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.

NameTypeDescription
tokenUidString

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.

NameTypeDescription
managementTokenUidString

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);

}