Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Latest commit

 

History

History
79 lines (60 loc) · 2.94 KB

AuthenticationApi.md

File metadata and controls

79 lines (60 loc) · 2.94 KB

AuthenticationApi

All URIs are relative to https://api.criteo.com/marketing

Method HTTP request Description
oAuth2TokenPost POST /oauth2/token Authenticates provided credentials and returns an access token

oAuth2TokenPost

InlineResponse200 oAuth2TokenPost(clientId, clientSecret, grantType)

Authenticates provided credentials and returns an access token

Get the token necessary to perform any action through our API. You can create your API User in our Criteo platform <a href='https://marketing.criteo.com&#39; target='_blank'>here</a>. If you forgot your credentials (client_id and/or client_secret) you will need to reset them there.

Example

// Import classes:
import com.criteo.marketing.ApiClient;
import com.criteo.marketing.ApiException;
import com.criteo.marketing.Configuration;
import com.criteo.marketing.models.*;
import com.criteo.marketing.api.AuthenticationApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.criteo.com/marketing");

    AuthenticationApi apiInstance = new AuthenticationApi(defaultClient);
    String clientId = "clientId_example"; // String | API Client-Id or Username
    String clientSecret = "clientSecret_example"; // String | API Client secret or password
    String grantType = "\"client_credentials\""; // String | Other grant types are not available
    try {
      InlineResponse200 result = apiInstance.oAuth2TokenPost(clientId, clientSecret, grantType);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AuthenticationApi#oAuth2TokenPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
clientId String API Client-Id or Username [optional]
clientSecret String API Client secret or password [optional]
grantType String Other grant types are not available [optional] [default to "client_credentials"]

Return type

InlineResponse200

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad request, invalid syntax -
403 Forbidden -
429 Rate limit reached -
500 Unknown Error -