ExAliyun.OpenAPI (ex_aliyun_openapi v0.8.1) View Source

Functions to call Aliyun OpenAPI.

  • You can just put addition args.
  • You can find the api params in Official Link.

Link to this section Summary

Functions

Aliyun Authenticate Sig Service(人机验证). You can read the doc in Official Link.

Aliyun Project Task Service of CodeUp (云效任务管理). You can read the doc in Official Link.

Aliyun Cloud Push Service(移动推送). You can read the doc in Official Link.

Aliyun Describe Ipv4/6 Location Service(查询IPv4地理位置信息) Please note that when using API to query IP Location Information, you need to open the relevant service in the Product package page first. You can read the doc in Official Link.

Global Aliyun Short Message Service(国际短信服务). You can read the doc in Official Link.

Aliyun Short Message Service(短信服务). You can read the doc in Official Link.

Aliyun Security Token Service(短期访问权限). You can read the doc in Official Link.

Perform a POST request.

Perform a POST request.

Perform request and raise in case of error.

Link to this section Types

Specs

option() ::
  {:method, Tesla.Env.method()}
  | {:url, Tesla.Env.url()}
  | {:query, Tesla.Env.query()}
  | {:headers, Tesla.Env.headers()}
  | {:body, Tesla.Env.body()}
  | {:opts, Tesla.Env.opts()}

Link to this section Functions

Link to this function

call_afs(params, access_info \\ nil)

View Source

Aliyun Authenticate Sig Service(人机验证). You can read the doc in Official Link.

Link to this function

call_codeup(params, access_info \\ nil)

View Source

Aliyun Project Task Service of CodeUp (云效任务管理). You can read the doc in Official Link.

Link to this function

call_cps(params, access_info \\ nil)

View Source

Aliyun Cloud Push Service(移动推送). You can read the doc in Official Link.

Link to this function

call_geoip(params, access_info \\ nil)

View Source

Aliyun Describe Ipv4/6 Location Service(查询IPv4地理位置信息) Please note that when using API to query IP Location Information, you need to open the relevant service in the Product package page first. You can read the doc in Official Link.

Link to this function

call_global_sms(params, access_info \\ nil)

View Source

Global Aliyun Short Message Service(国际短信服务). You can read the doc in Official Link.

Link to this function

call_sms(params, access_info \\ nil)

View Source

Aliyun Short Message Service(短信服务). You can read the doc in Official Link.

Link to this function

call_sts(params, access_info \\ nil)

View Source

Aliyun Security Token Service(短期访问权限). You can read the doc in Official Link.

Link to this function

get_access_info(service)

View Source
Link to this function

post(client, url, body, opts)

View Source

Specs

Perform a POST request.

See request/1 or request/2 for options definition.

post("/users", %{name: "Jon"})
post("/users", %{name: "Jon"}, query: [scope: "admin"])
post(client, "/users", %{name: "Jon"})
post(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
Link to this function

post!(client, url, body, opts)

View Source

Specs

Perform a POST request.

See request!/1 or request!/2 for options definition.

post!("/users", %{name: "Jon"})
post!("/users", %{name: "Jon"}, query: [scope: "admin"])
post!(client, "/users", %{name: "Jon"})
post!(client, "/users", %{name: "Jon"}, query: [scope: "admin"])
Link to this function

request(client \\ %Tesla.Client{}, options)

View Source

Specs

Perform a request.

Options

  • :method - the request method, one of [:head, :get, :delete, :trace, :options, :post, :put, :patch]
  • :url - either full url e.g. "http://example.com/some/path" or just "/some/path" if using Tesla.Middleware.BaseUrl
  • :query - a keyword list of query params, e.g. [page: 1, per_page: 100]
  • :headers - a keyworld list of headers, e.g. [{"content-type", "text/plain"}]
  • :body - depends on used middleware:
    • by default it can be a binary
    • if using e.g. JSON encoding middleware it can be a nested map
    • if adapter supports it it can be a Stream with any of the above
  • :opts - custom, per-request middleware or adapter options

Examples

ExampleApi.request(method: :get, url: "/users/path")

# use shortcut methods
ExampleApi.get("/users/1")
ExampleApi.post(client, "/users", %{name: "Jon"})
Link to this function

request!(client \\ %Tesla.Client{}, options)

View Source

Specs

request!(Tesla.Env.client(), [option()]) :: Tesla.Env.t() | no_return()

Perform request and raise in case of error.

This is similar to request/2 behaviour from Tesla 0.x

See request/2 for list of available options.