MEP APIs
Remove an End User from a Subscription
This operation enables you to remove an end user from a subscription.
Quick facts
Try It Out
If you'd like to try out this call using cURL, see Making Subscription Requests, which will take you through tasks such as creating and disabling subscriptions, and adding or removing end users.
Making a Request
Definition
GET https://cmx2api.openmarket.com/subscriptionapi/removeuser
URL example
https://cmx2api.openmarket.com/subscriptionapi/removeuser?username=MyUsername&password=P4S5W0Rd&subscription=A1B2C3D4E5F6&msisdn=12515550130
Query parameters
Parameters must be URL encoded.
Parameter |
Description |
---|---|
username |
The username used to access MEP. Required: yes Type: string |
password |
The password associated with the MEP username. Required: yes Type: string |
subscription
|
The ID of the subscription that you are removing an end user from. Required: yes Type: string |
msisdn
|
Mobile number of the end user you are removing from the subscription. This must be in international format but without a leading + symbol. For example: 12515550145 (US). Required: yes Type: integer |
Header fields
There is no data required in the header.
Response from OpenMarket
Accepted requests
OpenMarket responds to a successful request with a status code of 200 and the details you have just added in the response body.
HTTP/1.1 200 OK Date: Tue, 15 Mar 2016 17:17:15 GMT Server: Apache-Coyote/1.1 Transfer-Encoding: chunked Content-Type: text/plain
<?xml version="1.0" encoding="ISO-8859-1"?> <users> <user> <msisdn>12515550100</msisdn> <network>CINGULARUS</network> <enabled>false</enabled> </user> </users>
If the end user does not exist in the subscription, or is already unsubscribed, then the response body contains the following:
<?xml version="1.0" ?>
<users>
</users>
Response body
The XML response body will include following data.
Element |
Description |
---|---|
users |
Root element. Contains the element: user. Returned: Always |
user |
Element containing information about the user. Returned: Always |
msidsn |
The end user's phone number. Type: integer Returned: If user was in subscription |
network |
The end user's mobile operator. Type: string Returned: If user was in subscription |
enabled |
Set to "false" in the response. This indicates that the end user was successfully removed from the subscription. Type: Boolean Returned: If user was in subscription |
Rejected requests
If your request is rejected then the body of the response will contain a plain text description of the error. For example:
HTTP/1.1 400 Bad Request Date: Tue, 15 Mar 2016 11:48:56 GMT Server: Apache-Coyote/1.1 Connection: close Transfer-Encoding: chunked Content-Type: text/plain
Your request is invalid, specifically the following parameter is incorrect: subscription=ABCDE
See Response error messages below for a list of the possible error messages.
Testing your integration
As subscription operations do not send messages, the best way to test your integration is directly with MEP. We recommend that you test regularly as you build your campaigns and services in MEP, so that you can troubleshoot any issues faster.
For more information on using each operation, see Making Subscription Requests.
Troubleshooting
Response error messages
These error messages are returned in the response body when there was a problem with receiving the request.
Message |
Description |
---|---|
Your request is invalid, specifically the following parameter is incorrect: <parameter>=<value> |
You request contains a problem with the specified mandatory parameter that has stopped MEP from being able to process the request. If the <value> is “null”, then the parameter name is misspelled or the parameter is missing. Otherwise, the value you specified is invalid or does not match the available options. Correct the error and resend the message. |
Your username and/or password is incorrect. Check and try again. |
Either the username or the password parameter has not been correctly specified. Both parameters are mandatory. Check that both parameters are specified, and that you have entered the correct values for each parameter. |
You do not have the necessary roles or permissions to perform the action: <description> |
Your access rights in MEP do not allow you use the operation. The information in the <description> part of the response will tell you the role or permission that you are missing. |