All URIs are relative to https://api.phrase.com/v2
Method | HTTP request | Description |
---|---|---|
authorization_create | POST /authorizations | Create an authorization |
authorization_delete | DELETE /authorizations/{id} | Delete an authorization |
authorization_show | GET /authorizations/{id} | Get a single authorization |
authorization_update | PATCH /authorizations/{id} | Update an authorization |
authorizations_list | GET /authorizations | List authorizations |
AuthorizationWithToken authorization_create(authorization_create_parameters, opts)
Create an authorization
Create a new authorization.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::AuthorizationsApi.new
authorization_create_parameters = Phrase::AuthorizationCreateParameters.new({note: 'My Deploy Script'}) # AuthorizationCreateParameters |
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}
begin
#Create an authorization
result = api_instance.authorization_create(authorization_create_parameters, opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling AuthorizationsApi->authorization_create: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
authorization_create_parameters | AuthorizationCreateParameters | ||
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
Response<(AuthorizationWithToken)>
- Content-Type: application/json
- Accept: application/json
authorization_delete(id, opts)
Delete an authorization
Delete an existing authorization. API calls using that token will stop working.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::AuthorizationsApi.new
id = 'id_example' # String | ID
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}
begin
#Delete an authorization
api_instance.authorization_delete(id, opts)
rescue Phrase::ApiError => e
puts "Exception when calling AuthorizationsApi->authorization_delete: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | ID | |
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
Response<(nil (empty response body))>
- Content-Type: Not defined
- Accept: Not defined
Authorization authorization_show(id, opts)
Get a single authorization
Get details on a single authorization.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::AuthorizationsApi.new
id = 'id_example' # String | ID
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}
begin
#Get a single authorization
result = api_instance.authorization_show(id, opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling AuthorizationsApi->authorization_show: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | ID | |
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
Response<(Authorization)>
- Content-Type: Not defined
- Accept: application/json
Authorization authorization_update(id, authorization_update_parameters, opts)
Update an authorization
Update an existing authorization.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::AuthorizationsApi.new
id = 'id_example' # String | ID
authorization_update_parameters = Phrase::AuthorizationUpdateParameters.new # AuthorizationUpdateParameters |
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}
begin
#Update an authorization
result = api_instance.authorization_update(id, authorization_update_parameters, opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling AuthorizationsApi->authorization_update: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
id | String | ID | |
authorization_update_parameters | AuthorizationUpdateParameters | ||
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
Response<(Authorization)>
- Content-Type: application/json
- Accept: application/json
Array<Authorization> authorizations_list(opts)
List authorizations
List all your authorizations.
# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
# Configure HTTP basic authorization: Basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
# Configure API key authorization: Token
config.api_key['Authorization'] = 'YOUR API KEY'
config.api_key_prefix['Authorization'] = 'token'
end
api_instance = Phrase::AuthorizationsApi.new
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
page: 1, # Integer | Page number
per_page: 25 # Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
}
begin
#List authorizations
result = api_instance.authorizations_list(opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling AuthorizationsApi->authorizations_list: #{e}"
end
Name | Type | Description | Notes |
---|---|---|---|
x_phrase_app_otp | String | Two-Factor-Authentication token (optional) | [optional] |
page | Integer | Page number | [optional] |
per_page | Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default | [optional] |
Response<(Array<Authorization>)>
- Content-Type: Not defined
- Accept: application/json