portal_api_wrapper v0.1.0 PortalApiWrapper
Documentation for PortalApiWrapper.
Link to this section Summary
Functions
Make a create call against against an api collection
Make an index call against against an api collection
Make a show call against against an object in an api collection
Make an update call against against an object in an api collection
Link to this section Functions
Link to this function
create(collection, params, token)
Make a create call against against an api collection
collection
is the atom name of the collection, e.g., :campaigns, :order_lines, etsparams
is the request bodytoken
is the auth token to include in the header
returns one of:
- {:ok, object} where object is teh created object
- {:error, code: code} response had non 200 code
- {:error, _} request failed, no response
Link to this function
index(collection, search_params, paging_params, token)
Make an index call against against an api collection
collection
is the atom name of the collection, e.g., :campaigns, :order_lines, etssearch_params
is a keyword list of search paramspaging_params
is a keyword list of paging paramstoken
is the auth token to include in the header
returns one of:
- {:ok, results, paging} where results is a list and paging is a map
- {:error, code: code} response had non 200 code
- {:error, _} request failed, no response
Link to this function
show(collection, object_id, token)
Make a show call against against an object in an api collection
collection
is the atom name of the collection, e.g., :campaigns, :order_lines, etsobject_id
is the id of the object in questiontoken
is the auth token to include in the header
returns one of:
- {:ok, object} where object is teh created object
- {:error, code: code} response had non 200 code
- {:error, _} request failed, no response
Link to this function
update(collection, object_id, params, token)
Make an update call against against an object in an api collection
collection
is the atom name of the collection, e.g., :campaigns, :order_lines, etsobject_id
is the id of the object in questionparams
is the map of updates to applytoken
is the auth token to include in the header
returns one of:
- {:ok, object} where object is teh created object
- {:error, code: code} response had non 200 code
- {:error, _} request failed, no response