Method: PrintNode::Client#create_apikey

Defined in:
lib/printnode/client.rb

#create_apikey(description) ⇒ Object

Sends a POST request to /account/apikey/(description).

Returns:

The API-Key that was created.

Parameters:

  • description (String)

    Description of the API-Key to be made.



282
283
284
285
# File 'lib/printnode/client.rb', line 282

def create_apikey(description)
  end_point_url = '/account/apikey/' + escape_with_types(description)
  JSON.parse('[' + post(end_point_url).body + ']')[0]
end