Skip to content
Shortcut: /, ⌘K or Ctrl+K

Media

View as Markdown

Start a media upload

POST/graph/whatsapp/{version}/{appId}/uploadsGraph APIMeta Cloud API
Base URL
https://api.polymorfa.com
Required permission
messages:write

Start a resumable upload. Pass file_name, file_length and file_type as query parameters; returns { id: "upload:<SESSION_ID>" } whose id is the path of the subsequent append call.

Path parameters

  • versionstringrequired

    Specifies version for this path parameter.

  • appIdstringrequired

    Identifier of the connected application.

Query parameters

  • file_namestring

    Human-readable file name for this query parameter.

  • file_lengthstring

    Specifies file length for this query parameter.

  • file_typestring

    IANA media type that matches the uploaded file.

    • Media type: IANA type/subtype value matching the payload, such as application/pdf, text/plain, or application/vnd.openxmlformats-officedocument.wordprocessingml.document

Responses

POST /graph/whatsapp/{version}/{appId}/uploadscURL

Graph API v26.0. The version is part of the URL; Graph requests take no Polymorfa-Version header.

curl -X POST "https://api.polymorfa.com/graph/whatsapp/v26.0/<appId>/uploads" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
null

Get media

GET/graph/whatsapp/{version}/{objectId}Graph APILinked Device APIMeta Cloud API
Base URL
https://api.polymorfa.com
Required permission
media:read

Path parameters

  • versionstringrequired

    Specifies version for this path parameter.

  • objectIdstringrequired

    Identifier for the object.

Responses

  • 200Media metadata
    • messaging_productstringrequired

      Messaging product associated with this Graph API object.

    • urlstringrequired

      URL associated with this resource.

    • mime_typestringrequired

      IANA media type that matches the media payload.

      • Media type: IANA type/subtype value matching the payload, such as image/jpeg, video/mp4, audio/ogg, or application/pdf

    • sha256stringrequired

      Specifies sha256 for this graph graph media info response.

    • file_sizenumberrequired

      Specifies file size for this graph graph media info response.

    • idstringrequired

      Identifier for this resource.

    Show 3 headers
  • 400Bad request
  • 401Unauthenticated
  • 403Permission error
  • 404Object does not exist
  • 429Rate limited
  • 500Internal error
GET /graph/whatsapp/{version}/{objectId}cURL

Graph API v26.0. The version is part of the URL; Graph requests take no Polymorfa-Version header.

curl "https://api.polymorfa.com/graph/whatsapp/v26.0/<objectId>" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "messaging_product": "string",
  "url": "string",
  "mime_type": "string",
  "sha256": "string",
  "file_size": 0,
  "id": "string"
}

Upload media bytes

POST/graph/whatsapp/{version}/{objectId}Graph APIMeta Cloud API
Base URL
https://api.polymorfa.com
Required permission
messages:write

Append the raw file bytes to a resumable upload session. The request body is the binary file contents (no multipart wrapper); send file_offset: 0 on the first call. Returns { h: "<FILE_HANDLE>" } on success.

Path parameters

  • versionstringrequired

    Specifies version for this path parameter.

  • objectIdstringrequired

    Identifier for the object.

Body

Responses

POST /graph/whatsapp/{version}/{objectId}cURL

Graph API v26.0. The version is part of the URL; Graph requests take no Polymorfa-Version header.

curl -X POST "https://api.polymorfa.com/graph/whatsapp/v26.0/<objectId>" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @<file_path>
Response
null

Upload media

POST/graph/whatsapp/{version}/{phoneNumberId}/mediaGraph APILinked Device APIMeta Cloud API
Base URL
https://api.polymorfa.com
Required permission
media:manage

Path parameters

  • versionstringrequired

    Specifies version for this path parameter.

  • phoneNumberIdstringrequired

    Identifier for the phone number.

Body

  • messaging_productstringrequired

    Messaging product associated with this Graph API object.

  • typestring

    Type discriminator for this object.

  • filestring (binary)

    Specifies file for this graph graph media upload request.

Responses

POST /graph/whatsapp/{version}/{phoneNumberId}/mediacURL

Graph API v26.0. The version is part of the URL; Graph requests take no Polymorfa-Version header.

curl -X POST "https://api.polymorfa.com/graph/whatsapp/v26.0/<phoneNumberId>/media" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F 'messaging_product=whatsapp' \
  -F 'type=<type>' \
  -F 'file=@<file_path>'
Response
{
  "id": "string"
}

Download uploaded media

GET/graph/whatsapp/{version}/{mediaId}/downloadGraph APILinked Device APIMeta Cloud API
Base URL
https://api.polymorfa.com
Required permission
media:read

Path parameters

  • versionstringrequired

    Specifies version for this path parameter.

  • mediaIdstringrequired

    Identifier for the media.

Responses

GET /graph/whatsapp/{version}/{mediaId}/downloadcURL

Graph API v26.0. The version is part of the URL; Graph requests take no Polymorfa-Version header.

curl "https://api.polymorfa.com/graph/whatsapp/v26.0/<mediaId>/download" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response

Content type application/octet-stream

No example for this content type

Delete uploaded media

DELETE/graph/whatsapp/{version}/{objectId}Graph APILinked Device APIMeta Cloud API
Base URL
https://api.polymorfa.com
Required permission
media:manage

Path parameters

  • versionstringrequired

    Specifies version for this path parameter.

  • objectIdstringrequired

    Identifier for the object.

Responses

DELETE /graph/whatsapp/{version}/{objectId}cURL

Graph API v26.0. The version is part of the URL; Graph requests take no Polymorfa-Version header.

curl -X DELETE "https://api.polymorfa.com/graph/whatsapp/v26.0/<objectId>" \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "success": true
}