Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

API & Integration


How to handle record duplication in multiple objects request

Not applicable
Posts: 10
1113     0

I'm calling /wapi/v2.7.3/request with such kind of body to improve efficiency

{ "method": "POST", "object": "record:a", "data":{"name":"test1.pft.com", "ipv4addr":"", "view":"internal"}},
{ "method": "POST", "object": "record:a", "data":{"name":"test2.pft.com", "ipv4addr":"", "view":"internal"}},
{ "method": "POST", "object": "record:a", "data":{"name":"test3.pft.com", "ipv4addr":"", "view":"internal"}}

 but I met a problem, one of the record is already there, so the whole request failed with error.

My requirement is :

if there is no record there, create one; otherwise, update the record to the new value

similar to the "upsert" logic in database.


Is there a way to implement it in one multiple objects request?

Any suggestion?


Re: How to handle record duplication in multiple objects request

Posts: 145
1113     0



The request object is used as a single point of entry to make multiple calls. It is not meant for the purpose of implementing a conditional logic.


You can try doing a CSV import instead. For more information, refer to the "Import a CSV file" section in the WAPI reference guide here


Here is a sample CSV format you can use.

ARecord,test1.demo.com	,,internal
ARecord,test2.demo.com	,,internal

Hope this helps,


Showing results for 
Search instead for 
Do you mean 

Recommended for You