Media Providers

/v1/settings/application/media/providers

Use the /v1/settings/application/media/providers endpoint to compile a list of media providers for sending media links.

A providers list allows you to have different media providers for the same provider type while being able to pick a provider to use on a per request basis.

This document covers:

Updating the Providers List

To configure providers for the WhatsApp Business API Client, use the /v1/settings/application/media/providers endpoint with the provider's information. Currently, you can only set up one provider at a time. Also, for now, you can only use these provider objects for sending media messages using HTTP/HTTPS links that rely on either basic authentication or bearer token authentication.

Request

The below examples shows adding a WWW (i.e., HTTP/HTTPS links) provider with basic authorization and a provider with bearer token authentication. Currently, these are the only provider formats that are supported.

POST /v1/settings/application/media/providers
[{
    "name": "your-first-provider",
    "type": "www",
    "config": {
        "basic": {
            "username": "your-username",
            "password": "your-password"
        }
    }
 }
]
POST /v1/settings/application/media/providers
[{
    "name": "your-second-provider",
    "type": "www",
    "config": {
        "bearer": "your-bearer-token"
    }
 }
]

Note: Be sure to give each provider a unique name as reusing a name will overwrite the previous entry.

Parameters

NameRequiredDescription

name

Yes

The name for the provider

type

Yes

The type of provider

config

Yes

The config object

Response

A successful request returns the HTTP Status Code 200 OK and either null or {}.

An unsuccessful response will contain an error message. See Error and Status Codes for more information on errors.

Retrieving the Providers List

Request

GET /v1/settings/application/media/providers

Response

The successful response includes the list of providers.

"settings": {
        "application": {
            "media": {
                "providers": [ 
                    {
                        "name": "your-first-provider",
                        "type": "www",
                        "config": {
                            "basic": {
                                "username": "your-username",
                                "password": "your-password"
                            }
                        }
                    },
                    {
                        "name": "your-second-provider",
                        "type": "www",
                        "config": {
                            "bearer": "your-bearer-token"
                        }
                    }
                ]
            }
        }
    }

An unsuccessful response will contain an error message. See Error and Status Codes for more information on errors.

Deleting the Providers List

Sending a DELETE API call with the name of a provider to the /v1/settings/application/media/providers endpoint will delete that provider from the provider list.

Request

DELETE /v1/settings/application/media/providers/your-config-name

Response

A successful request returns the HTTP Status Code 200 OK and either null or {}.

An unsuccessful response will contain an error message. See Error and Status Codes for more information on errors.