Batch record modification
Modify multiple records in batch mode in a project.
If the value field (that can handle only one value) contains text, then:
- it finds the field value based on the text input, and sets it (based on the id)
- if it does not find the field value, then it automatically creates a new field value
If the value field (that can handle more than one value) contains text, then:
- it attempts to divide the text separated by the “|” character
- if it doesn’t find any “|” character, then it handles it as one value
The followings apply to each separated value:
- it finds the field value based on the text input, and sets it (based on the id)
- if it does not find the field value, then it automatically creates a new field value
Note: There is no limit on how many batches you can submit to update. If it fails due to timeout, please try to limit the query to fewer data.
Request | |
---|---|
Method | PUT |
Resource | https://[customer].asp.virtual-call-center.eu/v2/projects/[projectid]/records |
Options | N/A |
Body | Customized data, encoded in JSON. |
Response | |
Body | Array of partial results by elements. |
Request
Resource parameters
Name | Type | Mandatory | Comment |
---|---|---|---|
customer | string | yes | Your call centre’s unique identifier (subdomain). |
projectid | integer | yes | Unique project identifier. |
Request object
Name | Type | Mandatory | Comment |
---|---|---|---|
default | object | no | Key value pairs that should be set for every record, specified by an ‘element’ object. |
elements | array of objects | yes | Array of element objects to be set. |
Name | Type | Mandatory | Comment |
---|---|---|---|
form | object | yes | Custom data fields to be set as key value pairs. |
numberid | string | yes/no | Unique record identifier specifying a record to be set. Either ‘search’ or ‘numberid’ can be set. |
search | object | yes/no | Specifies a record to which key value pairs should be applied to. Either ‘search’ or ‘numberid’ can be set. |
Response
Array of partial results by elements.
Example
URL: https://mycc.asp.virtual-call-center.eu/v2/projects/22/records
Request body
{
"elements": [
{
"form": {
"name": "Peter Green",
"city": "Budapest",
"likes": "sports|movies"
},
"search": {
"name": "Green"
}
},
{
"form": {
"name": "Thomas",
"address": "London"
},
"numberid": "4"
}
],
"default": {
"address": "Budapest",
"age": "30"
}
}
Response body
{
"errors": [],
"response": {
"0": true,
"1": true
}
}
Response body if partially successful
{
"errors": [
{
"errorcode": 417,
"errormessage": "error.missing_numberid_or_search",
"index": 1
}
],
"response": {
"0": true,
"2": true
}
}
Comments
Can’t find what you need? Use the comment section below to connect with others, get answers from our experts, or share your ideas with us.
There are no comments yet.