Send a new request
This endpoint allows you to send a new request to a new contacts or to an existing contact.
Body
-
The ID of the campaign you want to use to send a request.
contact string | object Required
-
items array[string]
An array of itemId. If you want to request only few elements of the campaign, you can optionaly specify which elements you want to include in your request.
-
data object
An object with custom data that you want to use in your request.
-
sample object
An object that represents the sample of a document element. The object must contain 2 parameters: 'itemId' and 'url'.
-
dueDate string
The due date of the request. The due date should be encoded as a string using ISO 8601 format.
-
createdBy string
The ID of the user that is sending the request. This user must have access to the request.
-
assignedTo string
The ID of the team member you want to assign the request to. You can also use the email address of the team member.
-
sendMessage boolean
Boolean. If set to false, the sequence of messages planned in your campaign will not be sent.
-
sendCompletionMessage boolean
Boolean. If set to true, a message will be automatically send when the request status will be changed to "completed". This message can be customized in the branding settings used for this campaign.
-
sendRejectionMessage boolean
Boolean. If set to true, a message will be automatically send when the request status will be changed to "pending" and at least one element on the portal has been rejected. This message can be customized in the branding settings used for this campaign.
-
sendReopenMessage boolean
Boolean. If set to true, a message will be automatically send when the request status will be changed to "pending". This message can be customized in the branding settings used for this campaign.
Responses
-
200 application/json
List of requests of a campaigns.
-
Bad Request -- Your request is invalid.
-
Unauthorized -- Your API key is wrong.
-
Forbidden -- The object requested is hidden for administrators only.
-
Not Found -- The specified object could not be found.
-
Too Many Requests -- You're requesting too many objects! Slow down!
-
Internal Server Error -- We had a problem with our server. Try again later.
-
Service Unavailable -- We're temporarily offline for maintenance. Please try again later.
curl \
-X POST https://api.usecollect.com/v1/request \
-H "Content-Type: application/json" \
-d '{"contact":{"data":{"brand":"Tesla","model":"Roadster"},"email":"elon@example.com","company":"Tesla","lastName":"Musk","firstName":"Elon"},"campaignId":"xvr69EYLKXvTkfYuk"}'
{
"contact": {
"data": {
"brand": "Tesla",
"model": "Roadster"
},
"email": "elon@example.com",
"company": "Tesla",
"lastName": "Musk",
"firstName": "Elon"
},
"campaignId": "xvr69EYLKXvTkfYuk"
}
{
"contact": "WmTjsFknzHdmfs3Ra",
"campaignId": "xvr69EYLKXvTkfYuk"
}
{
"errors": [],
"request": {
"_id": "nw42MmBsJoccgutST",
"status": "pending",
"contact": {
"_id": "WmTjsFknzHdmfs3Ra",
"email": "johndoe@example.com",
"lastName": "Doe",
"createdAt": "2022-07-03T13:51:27Z",
"firstName": "John",
"nbRequest": 5,
"lastActivity": "2022-07-04T07:20:06Z"
},
"dueDate": "2022-07-11T21:59:00Z",
"privacy": "private",
"branding": {
"useBranding": false
},
"createdAt": "2022-07-04T07:20:06Z",
"portalUrl": "https://app.usecollect.com/portal/uGFRDeEL3Ct2uYo2c/nw42MmBsJoccgutST",
"campaignId": "xvr69EYLKXvTkfYuk"
}
}