0

Is it possible to use marketing cloud rest api to check if contact with specific key exists in all contacts without any contact data creation or modifications?

I tried to search rest api documentation but did not see such call?

1 Answer 1

1

You can search for a contact by attributes. Just search where a given Contact Key equals some value, and then check the response to confirm whether a contact was found for that criteria.

Host: https://www.exacttargetapis.com
POST /contacts/v1/contacts/search
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
Payload: 

{ 
   "request":{ 
      "attributes":[ 
         { 
            "key":"Contact.Contact Key"
         }
      ]
   },
   "conditionSet":{ 
      "operator":"And",
      "conditionSets":[ 

      ],
      "conditions":[ 
         { 
            "attribute":{ 
               "key":"Contact.Contact Key"
            },
            "operator":"Equals",
            "value":{ 
               "items":[ 
                  "SomeKey"
               ]
            }
         }
      ]
   }
}
4
  • Hey Jason - do you have a link to the reference/documentation for this API? Commented Oct 16, 2019 at 0:58
  • I tried this and got 404 not found. I'm using newer endpoints with subdomains *.rest.marketingcloudapis.com
    – roisto
    Commented Oct 16, 2019 at 8:54
  • Can you edit your answer to post what you have tried? The endpoint and payload above should give you a 200 response. Commented Oct 16, 2019 at 14:10
  • my mistake as I was using GET instead of POST method. I can get 200 response correctly now
    – roisto
    Commented Oct 17, 2019 at 9:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .