Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Latest commit

 

History

History
60 lines (42 loc) · 2.63 KB

Oauth2Api.md

File metadata and controls

60 lines (42 loc) · 2.63 KB

Oauth2Api

All URIs are relative to https://api.meltwater.com

Method HTTP request Description
createToken POST /oauth2/token Create an access token

createToken

OAuth2Token createToken(userKey, authorization, grantType, scope)

Create an access token

Create an OAuth2 access token based on the provided `client_id` and `client_secret`. #### Appendix The Base64-encoded `client_id`:`client_secret` string can be generated in a terminal with following command: $ echo -n &quot;your_client_id:your_client_secret&quot; | base64 <i>You will need `base64` installed.</i>

Example

// Import classes:
//import io.swagger.client.ApiException;
//import io.swagger.client.api.Oauth2Api;


Oauth2Api apiInstance = new Oauth2Api();
String userKey = "userKey_example"; // String | The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
String authorization = "authorization_example"; // String | `client_id:client_secret`  Basic Auth (RFC2617) credentials. Must contain the realm `Basic` followed by a Base64-encoded `client_id`:`client_secret` pair.   #### Example:      Basic aAlfbb1haWxDSXhhDXxxZWKJAyZXQ=
String grantType = "grantType_example"; // String | OAuth2 grant type, use `client_credentials`
String scope = "scope_example"; // String | OAuth2 scope, use `search`
try {
    OAuth2Token result = apiInstance.createToken(userKey, authorization, grantType, scope);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling Oauth2Api#createToken");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
userKey String The `user_key` from developer.meltwater.com.
authorization String `client_id:client_secret` Basic Auth (RFC2617) credentials. Must contain the realm `Basic` followed by a Base64-encoded `client_id`:`client_secret` pair. #### Example: Basic aAlfbb1haWxDSXhhDXxxZWKJAyZXQ=
grantType String OAuth2 grant type, use `client_credentials`
scope String OAuth2 scope, use `search`

Return type

OAuth2Token

Authorization

No authorization required

HTTP request headers

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