Skip to content

Latest commit

 

History

History
294 lines (207 loc) · 7.23 KB

File metadata and controls

294 lines (207 loc) · 7.23 KB

RankVectors::APIKeysApi

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

Method HTTP request Description
create_api_key POST /api/api-keys Create API key
delete_api_key DELETE /api/api-keys/{id} Delete API key
list_api_keys GET /api/api-keys List API keys
update_api_key PATCH /api/api-keys/{id} Update API key

create_api_key

create_api_key(create_api_key_request)

Create API key

Create a new API key for the authenticated user

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::APIKeysApi.new
create_api_key_request = RankVectors::CreateApiKeyRequest.new({name: 'WordPress Plugin'}) # CreateApiKeyRequest | 

begin
  # Create API key
  result = api_instance.create_api_key(create_api_key_request)
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling APIKeysApi->create_api_key: #{e}"
end

Using the create_api_key_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_api_key_with_http_info(create_api_key_request)

begin
  # Create API key
  data, status_code, headers = api_instance.create_api_key_with_http_info(create_api_key_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ApiKeyResponse>
rescue RankVectors::ApiError => e
  puts "Error when calling APIKeysApi->create_api_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
create_api_key_request CreateApiKeyRequest

Return type

ApiKeyResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

delete_api_key

delete_api_key(id)

Delete API key

Delete an API key

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::APIKeysApi.new
id = 'id_example' # String | API key ID

begin
  # Delete API key
  result = api_instance.delete_api_key(id)
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling APIKeysApi->delete_api_key: #{e}"
end

Using the delete_api_key_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> delete_api_key_with_http_info(id)

begin
  # Delete API key
  data, status_code, headers = api_instance.delete_api_key_with_http_info(id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeleteSuggestion200Response>
rescue RankVectors::ApiError => e
  puts "Error when calling APIKeysApi->delete_api_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String API key ID

Return type

DeleteSuggestion200Response

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_api_keys

<Array> list_api_keys

List API keys

Get all API keys for the authenticated user

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::APIKeysApi.new

begin
  # List API keys
  result = api_instance.list_api_keys
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling APIKeysApi->list_api_keys: #{e}"
end

Using the list_api_keys_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(<Array>, Integer, Hash)> list_api_keys_with_http_info

begin
  # List API keys
  data, status_code, headers = api_instance.list_api_keys_with_http_info
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Array<ApiKey>>
rescue RankVectors::ApiError => e
  puts "Error when calling APIKeysApi->list_api_keys_with_http_info: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Array<ApiKey>

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

update_api_key

update_api_key(id, update_api_key_request)

Update API key

Update an API key (activate/deactivate or change name)

Examples

require 'time'
require 'rankvectors'
# setup authorization
RankVectors.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = RankVectors::APIKeysApi.new
id = 'id_example' # String | API key ID
update_api_key_request = RankVectors::UpdateApiKeyRequest.new # UpdateApiKeyRequest | 

begin
  # Update API key
  result = api_instance.update_api_key(id, update_api_key_request)
  p result
rescue RankVectors::ApiError => e
  puts "Error when calling APIKeysApi->update_api_key: #{e}"
end

Using the update_api_key_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_api_key_with_http_info(id, update_api_key_request)

begin
  # Update API key
  data, status_code, headers = api_instance.update_api_key_with_http_info(id, update_api_key_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ApiKey>
rescue RankVectors::ApiError => e
  puts "Error when calling APIKeysApi->update_api_key_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
id String API key ID
update_api_key_request UpdateApiKeyRequest

Return type

ApiKey

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json