Module: Millionsend::ApiKeys

Defined in:
lib/millionsend/api_keys.rb

Overview

API keys. The token is only ever returned by create.

Class Method Summary collapse

Class Method Details

.create(params) ⇒ Object

POST /api-keys — name, permission ("full_access" default or "sending_access"), domain_id. Returns { id:, token: }.



9
10
11
# File 'lib/millionsend/api_keys.rb', line 9

def create(params)
  Millionsend::Request.new(method: :post, path: "/api-keys", body: params).perform
end

.list(options = {}) ⇒ Object

GET /api-keys — accepts limit:/after:/before:.



14
15
16
# File 'lib/millionsend/api_keys.rb', line 14

def list(options = {})
  Millionsend::Request.new(method: :get, path: "/api-keys", query: Millionsend::Util.list_query(options)).perform
end

.remove(id) ⇒ Object

DELETE /api-keys/:id



19
20
21
# File 'lib/millionsend/api_keys.rb', line 19

def remove(id)
  Millionsend::Request.new(method: :delete, path: "/api-keys/#{Millionsend::Util.encode(id)}").perform
end