Delete Profile List Recipients using query attribute

Deletes profile list recipients for a profile list using query attributes. Using the query parameters, specify a query attribute type to identify recipients, and the corresponding value. The response indicates how many matching records were deleted.

Up to 10 profile list recipients can be deleted in a single request.

Service URL:

/rest/api/v1.3/lists/{listName}/members

Required Path Parameters:

listName - Name of the profile list to delete recipients.

Query Parameters:

id - ID corresponding to the query attribute

qa - Query Attribute. Can be either 'r' (RIID_), 'e' (EMAIL_ADDRESS_), 'c' (CUSTOMER_ID_), or 'm' (MOBILE_NUMBER_).

Request Method:

DELETE

Request Header:

Authorization=<AUTH_TOKEN>

Request Body:

None

Sample Request URL:

Delete all profile list recipients in the DemoNewsLetterList with the email address example@oracle.com:

/rest/api/v1.3/lists/DemoNewsLetterList/members?qa=e&id=example@oracle.com

Sample Response in case of success:

{
  "recordData": {
    "fieldNames": [
      "EMAIL_ADDRESS"
    ],
    "records": [
      [
        "example@oracle.com"
      ]
    ],
    "mapTemplateName": null
  },
  "totalMatchedRecords": 1,
  "remainingRecordCount": 0,
  "hasMoreRecords": false,
  "links": [
    {
      "rel": "self",
      "href": "/rest/api/v1.3/lists/DemoNewsLetterList/members?qa=e&id=example@oracle.com",
      "method": "DELETE"
    },
    {
      "rel": "mergeListRecipients",
      "href": "/rest/api/v1.3/lists/DemoNewsLetterList/members",
      "method": "POST"
    },
    {
      "rel": "retrieveListRecipients",
      "href": "/rest/api/v1.3/lists/DemoNewsLetterList/members",
      "method": "GET"
    }
  ]
}

This API deletes up to 10 matching records per request. If more than 10 records are found, the hasMoreRecords property will be true, indicating more matching records exist in the list. The remainingRecordCount property will indicate how many more records exist. The response will resemble:

{
  "recordData": {
    "fieldNames": [
      "EMAIL_ADDRESS_"
    ],
    "records": [
      [
        "example@oracle.com"
      ]
    ],
    "mapTemplateName": null
  },
  "totalMatchedRecords": 115,
  "remainingRecordCount": 105,
  "hasMoreRecords": true,
  "links": [
    {
      "rel": "self",
      "href": "/rest/api/v1.3/lists/DemoNewsLetterList/members?qa=e&id=example@oracle.com",
      "method": "DELETE"
    },
    {
      "rel": "mergeListRecipients",
      "href": "/rest/api/v1.3/lists/DemoNewsLetterList/members",
      "method": "POST"
    },
    {
      "rel": "retrieveListRecipients",
      "href": "/rest/api/v1.3/lists/DemoNewsLetterList/members",
      "method": "GET"
    }
  ]
}

Sample Response in case of failure:

404 Not Found Errors

No records found for the given id: Requests fail when no records are found in the list for the id specified. The error resembles:

{
  "type": "",
  "title": "Record not found",
  "errorCode": "RECORD_NOT_FOUND",
  "detail": "No records found in the list for given id",
  "errorDetails": []
}

List not found: Requests fail if the specified profile list is not found. The error resembles:

{
  "type": "",
  "title": "List not found",
  "errorCode": "LIST_NOT_FOUND",
  "detail": "Profile_List_1 List Not Found",
  "errorDetails": []
}

400 Bad Request Errors

Invalid value for the specified id data type: Requests fail when an invalid id value is provided. For example, if a string value is provided for riid, when the value should be an integer. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "The value example@oracle.com is not valid for an integer field",
  "errorDetails": []
}

Invalid query attribute: Requests fail if an invalid query attribute is specified. Query Attribute must be either r, e, c, or m. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Query Attribute Must be either r, e, c, or m.",
  "errorDetails": []
}

Too many query attributes specified: Requests fail if more than one query attribute is specified. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "This query supports only one id",
  "errorDetails": []
}

A query attribute was not specified: Requests fail if no query attribute is specified. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Query Attribute is null OR empty",
  "errorDetails": []
}

No identifier specified: Requests fail if no id is specified. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "IdToRetrieve is null OR empty",
  "errorDetails": []
}

Invalid profile list name length: Requests fail if the length of the profile list name exceeds 100 characters. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Max Length of listName allowed: 100",
  "errorDetails": []
}

Profile list name contains invalid characters: Requests fail if the profile list name contains invalid characters. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Invalid characters in the List Name",
  "errorDetails": []
}