batch_elixir v0.2.2 BatchElixir.RestClient.Base View Source

Rest client for interating with the Batch API.

Link to this section Summary

Functions

Encode a body in JSON and send an HTTP request to an endpoint of Batch API

Send an HTTP request to an endpoint of Batch API

Link to this section Functions

Link to this function

encode_body_and_request(body, api_key, method, path) View Source

Encode a body in JSON and send an HTTP request to an endpoint of Batch API.

Parameters

  • body: Body sent in the request.
  • api_key: API key of your application
  • method: HTTP method, from one of :get, :post, :delete
  • path: Desired endpoint start with /

Examples

BatchElixir.RestClient.Base.request(%{"group_id" => "test"}, "my_rest_api_key", :post, "/transactional/send")

Link to this function

request(api_key, atom, path) View Source

Link to this function

request(body, api_key, method, path) View Source

Send an HTTP request to an endpoint of Batch API.

Parameters

  • body: Body sent in the request. For GET the body MUST be ""
  • api_key: API key of your application
  • method: HTTP method, from one of :get, :post, :delete
  • path: Desired endpoint start with /

Examples

BatchElixir.RestClient.Base.request(~s/{"group_id": "test"}/, "my_rest_api_key", :post, "/transactional/send")