Overview
You can use this request to add contacts to a Dynamic Data Set workflow.
The Method
| API | - | Method |
|---|---|---|
| REST | POST | https://[Your URL]/api/3.0/workflows/data-set/subscribe |
Parameters
| Property | Type | Description | Required |
|---|---|---|---|
| workflow_id | integer | The ID of the Workflow you want to add the contacts to. This can be found by hovering over the checkbox of the Workflow on the Workflow History page. | yes |
| contact_email | string | If you use this option, the contact will be found using their email address. If more than one contact exists with this email address, use the other field. | no |
| contact_unique_id | string | Use this field if you want to select the contact using their unique ID. You can set this field to whatever you like. | no |
| contact_mobile | string | If you use this option, the contact will be found using their mobile number. If more than one contact exists with this number, use the other field. | |
| Workflow dataset fields | Refer to documentation on workflow data set fields. |
Example Request
The following is a code sample for the request:
setRequestUrl('[your-url]/api/3.0/workflows/data-set/subscribe');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Authorization' => 'Basic =',
'Content-Type' => 'application/json',
'Authorization' => 'Basic =',
'Content-Type' => 'text/plain'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
Example Response
Success Result: Error Results Workflow not found Workflow not active Workflow not dataset Dataset validation errors Error no contact found