From Bright Pattern Documentation
Jump to: navigation, search
 
 
Line 1: Line 1:
 
<translate>= Add Many Records=
 
<translate>= Add Many Records=
 
This method adds multiple new records to the specified calling list. It returns an error if a record with the same values of unique keys as configured in the list definition already exists.
 
This method adds multiple new records to the specified calling list. It returns an error if a record with the same values of unique keys as configured in the list definition already exists.
 
  
 
== Request ==
 
== Request ==
 
=== URL ===
 
=== URL ===
http[s]://<host>:<port>/configapi/v2/callinglist/addAll/<list_name>
+
http[s]://<host>/configapi/v2/callinglist/addAll/<list_name>
  
 
=== Method ===  
 
=== Method ===  
Line 77: Line 76:
  
  
 
<center>[[list-management-api-specification/Addarecord|< Previous]]  |  [[list-management-api-specification/Updatearecord|Next >]]</center>
 
 
</translate>
 
</translate>

Latest revision as of 22:49, 17 September 2018

• 5.19 • 5.2 • 5.3 • 5.8

Add Many Records

This method adds multiple new records to the specified calling list. It returns an error if a record with the same values of unique keys as configured in the list definition already exists.

Request

URL

http[s]://<host>/configapi/v2/callinglist/addAll/<list_name>

Method

POST

Body Content Type

JSON array of objects

Body

[
       { "fieldName_1":"value_1", ...,  "fieldName_n":"value_n"},
          ...
] 

Notes

  • Field names are provided as they were defined during list creation.
  • Key fields and required fields are mandatory.


Response

Response Codes

Code Description
200 Success (may be partial success; additional problem description contained in response)
400 Bad request (format not understood)
401 Authentication failed
403 User authenticated but does not have sufficient privileges
404 Calling List is not found or invalid URL


Error Response

Content Type

JSON object ("error" attribute exists only if errors are found)

Result

{
       "added":1,
        "error":{
               "missingRequired":[
                       { "fieldName_1":"value_1", ...,  "fieldName_n":"value_n"},
                       ...
               ]
               "missingKey": [
                       { "fieldName_1":"value_1", ...,  "fieldName_n":"value_n"},
                       ...
               ]
               "duplicateKey":	[
                       { "fieldName_1":"value_1", ...,  "fieldName_n":"value_n"},
                       ...
               ]
               "formatError":	[
                       { "fieldName_1":"value_1", ...,  "fieldName_n":"value_n"},
                       ...
               ]
       }
} 


< Previous | Next >