PS2.API (PlanetSide 2 API v1.0.0)
View SourceFunctions for querying the Census API.
Use query/1 to get data from the Census.
iex> q = PS2.API.Query.new(collection: "character_name")
...> |> PS2.API.QueryBuilder.term("name.first_lower", "snowful")
%PS2.API.Query{
collection: "character_name",
joins: [],
params: %{"name.first_lower" => {"", "snowful"}},
sort: nil,
tree: nil
}
iex> PS2.API.query(q, "example")
{:ok,
%PS2.API.QueryResult{
data: [
%{
"character_id" => "5428713425545165425",
"name" => %{"first" => "Snowful", "first_lower" => "snowful"}
}
],
returned: 1
}
}
Summary
Functions
Gets a list of all the public API collections and their resolves.
Gets the image binary for a .png.
Gets the URL for an image.
Sends query to the Census API, returning {:ok, %QueryResult{}} struct on
success. req_opts is a keyword list of Req opts.
Sends query to the API and returns the first result if successful.
Functions
Gets a list of all the public API collections and their resolves.
@spec get_image(String.t(), String.t()) :: {:ok, binary()} | {:error, Exception.t()}
Gets the image binary for a .png.
Gets the URL for an image.
@spec query(PS2.API.Query.t(), String.t(), Keyword.t(), (service_id :: String.t() -> String.t())) :: {:ok, PS2.API.QueryResult.t()} | {:error, PS2.API.Error.t() | Exception.t()}
Sends query to the Census API, returning {:ok, %QueryResult{}} struct on
success. req_opts is a keyword list of Req opts.
@spec query_one(PS2.API.Query.t(), String.t(), Keyword.t(), (service_id :: String.t() -> String.t())) :: {:ok, PS2.API.QueryResult.t()} | {:error, PS2.API.Error.t() | Exception.t()}
Sends query to the API and returns the first result if successful.