Batch records modification

Reading Time: 2 minutes

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 values) 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 values:

  • 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
Request
Method PUT
Resource https://[customer].asp.virtual-call-center.eu/v2/projects/[projectid]/records
Options N/A
Body Customised 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.

Element object

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 succesful

{
    "errors": [
        {
            "errorcode": 417,
            "errormessage": "error.missing_numberid_or_search",
            "index": 1
        }
    ],
    "response": {
        "0": true,
        "2": true
    }
}

There are no comments yet.
Subscribe to our newsletter
or Contact us!
Please note that by subscribing to our newsletter, you agree to receive regular email messages from VCC Live® about service related news and updates. By subscribing to our newsletter, you also agree that VCC Live® will use your data in accordance with the applicable Privacy Policy until you unsubscribe from the newsletter.