How to create multiple records at once using Table APIs

Revathi10
Tera Expert

Hi all,

 

I want to create multiple records at once using POST Table API. I am using the below payload but it is throwing a 403 error.

 

API : POST https://<instance>.service-now.com/api/now/table/{tableName}

 

Payload structure:

{
'records': [{
'field1': 'val1',
'field2': 'val2'
},
{
'field1': 'val3',
'field2': 'val4'
},
{
'field1': 'val5',
'field2': 'val6'
}
]
}

 

Error:

403 Forbidden
{
"error": {
"message": "Operation Failed",
"detail": "Data Policy Exception: \n\tThe following fields are mandatory: "
},
"status": "failure"
}

 

Could you please help me out in this?

 

Many Thanks

1 REPLY 1

Veer
Tera Guru

@Revathi10  It is throwing a data policy exception, please pass the field values which are mandatory on the database level. Kindly check the data policies on the incident table and pass the data in the payload, it works.

Also through table API it is possible to create one incident, try using import set API or scripted rest API.