0

Unable to update criteria for an existing subscription

I am running into an issue where I keep getting a "400" error response from the xM API when I try to update the criteria property of a subscription. 

I have tried about a half dozen different type of data structures for my payload, I will post below some of the ones I have tried. 

I am sending this request to the "/subscriptions" endpoint. Some of my payloads have looked like this, each of which getting this same exact error:

Syntax error in request body

Payloads Tried:

 

*** Btw, this is POWERSHELL Code ***

## Tried mimicking the response payload of a subscription object
{
  "id": "[SUB UUID]",
  "criteria": {
    "total": 1,
    "count": 1,
    "data": [
      {
        "operator": "IS_ONE_OR_MORE_OF",
        "name": "Line of Business",
        "value": [
          "CFO: Dividend Management 2"
        ]
      }
    ]
  }
}
## Tried wrapping criteria in "data" array and making criteria a hash
{
  "id": "[SUB UUID]",
  "criteria": {
    "data": [
      {
        "operator": "IS_ONE_OR_MORE_OF",
        "name": "Line of Business",
        "values": ["CFO: Dividend Management 2"]
      }
    ]
  }
}

## BASED ON THE #CREATE from API Docs
{
  "id": "[SUB UUID]",
  "criteria": [
    {
      "operator": "IS_ONE_OR_MORE_OF",
      "name": "Line of Business",
      "values": ["CFO: Dividend Management 2"]
    }
  ]
}

 

Can anyone provide insight on this issue? Very confused...

 

 

4 comments

Please sign in to leave a comment.