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

Latest commit

 

History

History
65 lines (40 loc) · 2.45 KB

Oauth2Api.md

File metadata and controls

65 lines (40 loc) · 2.45 KB

SwaggerClient::Oauth2Api

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

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

create_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.

Example

# 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

Parameters

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`

Return type

OAuth2Token

Authorization

No authorization required

HTTP request headers

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