The Device Opt-out API blocks or unblocks specific devices from receiving push notifications triggered from MoEngage. To prevent push notifications from reaching a specific user or all devices associated with a user, call the API to block them. This is useful for reasons such as device theft or fraudulent activity. For example, if a device is stolen, you can use this API to block it in MoEngage, ensuring that any scheduled push notifications with sensitive content do not get delivered. You can also use the API to unblock a device if it is recovered.
This authentication parameter, used for access control, must be passed along with the request. The API request will be authenticated through Basic Authentication. Basic Authentication sends a Base64-encoded string containing your username and password with every API request. It encodes a 'username:password' string in Base64 and appends the encoded string with 'Basic '. This string is included in the authorization header as shown below:
{"Authorization: Basic Base64_ENCODED_WORKSPACEID_APIKEY=="}
The username and password details can be obtained from the MoEngage Dashboard. If you're using the API for the first time, follow these steps:
Use these details to authenticate the API requests.
This is the Workspace ID of your MoEngage account that must be included in the request. You can find your Workspace ID in the following navigation on the dashboard: Settings > Account > APIs > Workspace ID.
This field denotes the type of user identifier.
This field denotes the user identifier.
This field denotes the type of action to be achieved using this API.
block, unblock This field denotes the reason for blocking or unblocking a device.
This field denotes the reference ID of the user.
This field denotes the device identifiers associated with the device you intend to block or unblock. Supported values are:
unique_id (unique_id)device_unique_id (device_id)push_id (push_id)moe_gaid (GAID)Note: