Cloudsight API v0.4.0 CloudsightElixir

Core functions for interfacing with the API

Additional References: https://cloudsight.readme.io/reference

Link to this section Summary

Functions

Repost an image if it expired in the queue without returning a response

Retrieve the result of an image token

Retrieve the result of a video token

Send an image file or url to the Cloudsight API for identification

Send a video file or url to the Cloudsight API for identification

Poll for an image response until the timeout is reached - defaults to 20 seconds

Poll for an video response until the timeout is reached - defaults to 20 seconds

Link to this section Functions

Link to this function repost(token, client)
repost(binary(), Client.t()) :: {atom(), binary()}

Repost an image if it expired in the queue without returning a response

Examples

client = CloudsightElixir.Client.new("sample_api_key")
CloudsightElixir.repost("my_token", client)
Link to this function retrieve(token, client)
retrieve(binary(), Client.t()) :: {atom(), [{:key, binary()}]}
This function is deprecated. Use retrieve_image or retrieve_image instead.
Link to this function retrieve_image(token, client)
retrieve_image(binary(), Client.t()) :: {atom(), [{:key, binary()}]}

Retrieve the result of an image token

Examples

client = CloudsightElixir.Client.new("sample_api_key")
CloudsightElixir.retrieve_image("my_token", client)
Link to this function retrieve_video(token, client)
retrieve_video(binary(), Client.t()) :: {atom(), [{:key, binary()}]}

Retrieve the result of a video token

Examples

client = CloudsightElixir.Client.new("sample_api_key")
CloudsightElixir.retrieve_video("my_token", client)
Link to this function send(options, client)
send(map(), Client.t()) :: {atom(), [{:key, binary()}]}
This function is deprecated. Use send_image or send_video instead.
Link to this function send_image(options, client)
send_image(map(), Client.t()) :: {atom(), [{:key, binary()}]}

Send an image file or url to the Cloudsight API for identification

Examples

client = CloudsightElixir.Client.new(“sample_api_key”) CloudsightElixir.send_image(%{locale: “en”, remote_image_url: “https://dropbox.com/my_video.mp4”}, client)

client = CloudsightElixir.Client.new(“sample_api_key”) CloudsightElixir.send_image(%{locale: “en”, image: “./my_image.jpg”}, client)

Link to this function send_video(options, client)
send_video(map(), Client.t()) :: {atom(), [{:key, binary()}]}

Send a video file or url to the Cloudsight API for identification

Examples

client = CloudsightElixir.Client.new(“sample_api_key”) CloudsightElixir.send_video(%{locale: “en”, remote_video_url: “https://dropbox.com/my_video.mp4”}, client)

client = CloudsightElixir.Client.new(“sample_api_key”) CloudsightElixir.send_video(%{locale: “en”, video: “./my_video.mp4”}, client)

Link to this function wait_for(token, client)
wait_for(binary(), Client.t()) :: {atom(), [{:key, binary()}] | atom()}
This function is deprecated. Use wait_for_image or wait_for_video instead.
Link to this function wait_for(token, client, options)
Link to this function wait_for_image(token, client)
wait_for_image(binary(), Client.t()) :: {atom(), [{:key, binary()}] | atom()}

Poll for an image response until the timeout is reached - defaults to 20 seconds

Examples

client = CloudsightElixir.Client.new("sample_api_key")
CloudsightElixir.wait_for_image("my_token", client, %{ttl: 10_000}) # wait 10 seconds
Link to this function wait_for_image(token, client, options)
Link to this function wait_for_video(token, client)
wait_for_video(binary(), Client.t()) :: {atom(), [{:key, binary()}] | atom()}

Poll for an video response until the timeout is reached - defaults to 20 seconds

Examples

client = CloudsightElixir.Client.new("sample_api_key")
CloudsightElixir.wait_for_video("my_token", client, %{ttl: 10_000}) # wait 10 seconds
Link to this function wait_for_video(token, client, options)