Log in to see full request history

📘

Success response

In default asynchronous mode, a successful result does not signify that the message has been delivered to gateway, only that all validations have passed (eg. campaign exists, target set, params in correct format).

Review the campaign model properties page to see the available parameters.

Examples

Executing a campaign, targeting a single user by external ID and setting a number of variables in the campaign text.

curl --request POST \ --url https://external-api.xtremepush.com/api/external/execute/campaign \ --header 'content-type: application/json' \ --data '{ "apptoken": "YOURAPPTOKEN", "id": "CAMPAIGNID", "target_with_params": { "crm-user-1": {"fname": "Alex", "balance": "100 EUR"}, "crm-user-2": {"fname": "John", "balance": "80 EUR"} }, "target_by": "user_id" }'

Executing a campaign at a specific time and including external_message_id in the request, which is a customer-defined reference for the transaction. If passed, it is returned in the payload for the webhooks integration, to easily match transactions on the client’s end.

curl --request POST \ --url https://external-api.xtremepush.com/api/external/execute/campaign \ --header 'content-type: application/json' \ --data '{ "apptoken": "YOURAPPTOKEN", "id": "CAMPAIGNID", "target": ["user1", "user2"], "target_by": "user_id", "params": { "external_message_id": "987654321" }, "time": "2021-01-01 12:00 UTC" }'

Additional campaign parameters

You can use any of the regular parameters for the campaign model to set or overwrite campaign properties to add content, segment users, etc.

For example, you could add a payload like a deeplink to be used when the notification is opened:

curl --request POST \ --url https://external-api.xtremepush.com/api/external/execute/campaign \ --header 'content-type: application/json' \ --data '{ "apptoken": "YOURAPPTOKEN", "id": "CAMPAIGNID", "target": [123456], "payload_add": [ { "key": "URL_KEY", "value": "https://m.example.com/deeplink/123456" } ] }'

Another example, executing a campaign that enables the web push 'require interaction' option, and has a retry period of 2 weeks:

curl --request POST \ --url https://external-api.xtremepush.com/api/external/execute/campaign \ --header 'content-type: application/json' \ --data '{ "apptoken": "YOURAPPTOKEN", "id": "CAMPAIGNID", "target_by": "user_id", "target": ["12345"], "messages": { "3": { "push_require_interaction": true } }, "retry_for": 2, "retry_for_period": "weeks" }'

Another example of executing a campaign for a single user and including external_message_id in the request:

{ "apptoken": "YOURAPPTOKEN", "id": "CAMPAIGNID", "target_by": "user_id", "target_with_params": { "12345": { "first_name": "FIRSTNAME", "external_message_id": "987654321" } } }
Body Params
string
required

Your app token

int32
required

ID of the Campaign within Xtremepush

string

Specify the type of identifier used in target or target_with_params. Allowed values: id (Xtremepush device id - default), user_id (client-defined unique user/contact id), email, mobile_number, profile_id (Xtremepush profile ID), token (push token), or specific mobile OS identifiers: device_adid, device_idfv, device_idfa.

target
array of strings

List of targeted IDs, type defined by target_by. Eg. ["user1", "user2"]

target
json

An alternative to target parameter if you want to pass the values of any personalisation params you have in your campaign template message. Eg. {"user1": {"fname":"Alex","balance":"100 EUR"}, "user2": {"fname":"John", "balance": "80 EUR"}}

json

Personalisation params used when targeting a single user or all messages are to be modified with the same params. Eg. {"first_name":"Sam","balance":"500"}. Where params are defined they will be applied to all the targeted profiles; any overrides or additional params defined in target_with_params will be merged in or override the default set in params.

string

Optional to specify when to execute the campaign. It will be executed immediately if this param is omitted. You can use both date string and unix timestamp as a value.

string

Optional. If set to 0 your request will be processed completely before API response is returned. In this way you enable an extra level of error reporting being able to receive errors like: "Recipient not found", "Message is suppressed due to insufficient personalization params". The limitation of non-async mode is that you're only allowed to target a single profile/device. In case you need an extra level of reporting for batch sends you should use a separate query to fetch batch send status.

Responses

Language
Click Try It! to start a request and see the response here! Or choose an example:
application/json
Português (Brasil)
Powered by Localize
English