AtEx v0.20.21 AtEx.Gateway.Voice.UploadMedia View Source

This module holds the implementation for the HTTP Gateway that runs calls against the Africas Talking Voice API endpoint tfor uploading media file

Link to this section Summary

Functions

Process results from calling the gateway

This function makes a POST request to upload a media in the Africa's talking queue status endpoint, this function accepts a map of parameters. sent

Link to this section Types

Link to this type

option()

View Source
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

Process results from calling the gateway

This function makes a POST request to upload a media in the Africa's talking queue status endpoint, this function accepts a map of parameters. sent

Parameters

attrs: - a map containing:

  • username - Your Africa’s Talking application username. Can be set in the config
  • url - The url of the file to upload. Don’t forget to start with http://

Example

iex> AtEx.Gateway.Voice.UploadMedia.upload(%{
         phoneNumber: "+254728833180",
  ...>   url: "https://www.soundhelix.com/examples/mp3/SoundHelix-Song-8.mp3"
  ...> })
  {:ok, result}