logo   HOME

Media

This page lists the optional parameters, request data and reponse in xml

Create new media [HTTP POST]

https://appapi.dlangemobile.com/xml/media/{api_key}

URL Parameters

  • api_key (Required) - Your API application key.

Request Notes

  • MediaURL - Valid URL to a media file.
  • MediaContent - Media file byte array encoded in Base64.
  • MediaFileName - File name of the media file provided in MediaContent. Required only if MediaContent is provided.

Please note that either MediaURL or MediaContent should have a value. The media file size should be up to 740.0KB and supported files are Images(.png, .jpg, .jpeg, .gif), Audio(.mp3), Video(.mp4), and vCard(.vcf) only.

Example XML Request using MediaURL

<Media>
  <MediaURL>https://[valid domain address]/samplephoto.jpg</MediaURL>
</Media>

Example XML Request using MediaContent

<Media>
  <MediaContent>file's byte array encoded in Base64 here</MediaContent>
  <MediaFileName>samplephoto.jpg</MediaFileName>
</Media>

Example XML Response

<MediaResponse>
    <MediaId>aeaeeb29-4604-4ee5-9308-bc1222ba0d2b</MediaId>
    <MediaType>image</MediaType>
    <DateExpired>2023-08-17T17:36:19.9304303+08:00</DateExpired>
</MediaResponse>

Error Codes

  • 001 - API key is required.
  • 002 - Invalid API key.
  • 401 - No media provided. For sending MMS, please provide value for either MediaURL (a valid URL for the media file) or MediaContent (media file byte array encoded in Base64).
  • 402 - Invalid MediaURL. MediaURL should be a valid link to a media file.
  • 403 - Invalid media for MMS. Supported file types are .png, .jpg, .jpeg, .gif, .mp4, .mp3, and .vcf only.
  • 404 - Media file is too large. Please provide a media file of up to 740.0KB only.
  • 405 - MediaContent is not a valid file. It should be the media file byte array encoded in Base64.