MEP APIs
Delete a Variable
This operation enables you to delete a service or servicecoll variable.
Quick facts
Method |
GET |
Returns |
Plain text |
Available |
All regions |
Prerequisites |
|
More information |
See MEP Operations and Making Variable Requests. |
Try It Out
If you'd like to try out this call using cURL, see Making Variable Requests, which will take you through tasks such as creating, updating, retrieving and deleting variables.
Making a Request
Definition
GET https://cmx2api.openmarket.com/variableapi/delete
URL example
https://cmx2api.openmarket.com/variableapi/delete?username=MyUsername&password=P4S5W0Rd&id=1A2B3C4D5E6F&scope=service&key=rewardToday
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 |
id |
The ID of the service or service collection that you want to remove the variable from. For example: 2A019B40EB7DB0F. Required: yes Type: string |
scope |
The variable's scope. Either:
Required: yes Type: string |
key |
The variable’s key. Keys can use any character between A-Z, as well as the underscore, hyphen, and dot characters ("_ - . "). Variables are not case-sensitive. Required: yes Type: string |
Header fields
There is no data required in the header.
Response from OpenMarket
Accepted requests
If the variable was found, then MEP responds with a status code of 200 and the text “OK” in the response body.
HTTP/1.1 200 OK
Date: Tue, 15 Mar 2016 18:02:57 GMT
Server: Apache-Coyote/1.1
Content-Length: 2
Content-Type: text/plain
OK
If the variable does not exist for the service or service collection, then MEP responds with an HTTP status code of 204 and the text "Variable did not exist" in the response body.
HTTP/1.1 204 No Content OK Date: Tue, 15 Mar 2016 18:02:57 GMT Server: Apache-Coyote/1.1 Content-Length: 22 Content-Type: text/plain
Variable did not exist
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 401 Unauthorized Date: Tue, 15 Mar 2016 11:48:56 GMT Server: Apache-Coyote/1.1 Connection: close Transfer-Encoding: chunked Content-Type: text/plain
Your username and/or password is incorrect. Check and try again.
See Response error messages below for a list of the possible error messages.
Testing your integration
As variables operations do not send messages, the best way to test your integration is directly with MEP. We suggest creating a simple service, test that this works, then expand the service as required with other handlers and functionality. We recommend that you test regularly as you build your service, so that you can troubleshoot any service flow issues faster.
For more information on using each operation, see Making Variable 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 |
---|---|
The required parameter <parameter> was blank |
The specified parameter is mandatory and requires a value. MEP will reject the request until it is sent with a value for the parameter. |
The required parameter <parameter> was not provided |
The specified parameter is missing, or has been misspelled. Add the parameter and resend. |
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. |