All URIs are relative to https://api.meltwater.com
Method | HTTP request | Description |
---|---|---|
createToken | POST /oauth2/token | Create an access token |
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 "your_client_id:your_client_secret" | base64 <i>You will need `base64` installed.</i>
// 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();
}
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` |
No authorization required
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json