All URIs are relative to https://api.meltwater.com
Method | HTTP request | Description |
---|---|---|
create_token | POST /oauth2/token | Create an access token |
OAuth2Token create_token(user_key, authorization, grant_type, 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 You will need base64
installed.
# load the gem
require 'swagger_client'
api_instance = SwaggerClient::Oauth2Api.new
user_key = "user_key_example" # String | The `user_key` from [developer.meltwater.com](https://developer.meltwater.com/admin/applications/).
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=
grant_type = "grant_type_example" # String | OAuth2 grant type, use `client_credentials`
scope = "scope_example" # String | OAuth2 scope, use `search`
begin
#Create an access token
result = api_instance.create_token(user_key, authorization, grant_type, scope)
p result
rescue SwaggerClient::ApiError => e
puts "Exception when calling Oauth2Api->create_token: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
user_key | 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= | |
grant_type | 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