Required Field Not Throwing Error in REST API

Priya84
Mega Contributor

Hi,

I have required/mandatory fields in Customer_contact table. When i try to create (POST) a contact via REST API it is creating record with status 201. But  i have a required field account in customer_contacts table.

 

Please refer below imagefind_real_file.png

 

Below is the contact which i have created via REST API.

find_real_file.png

Below image is the response for contact creation.

find_real_file.png

 

 

My question is, Why error not Shown when i try to post a contact via REST API, though a required field is not sent in request payload. 

1 ACCEPTED SOLUTION

glad it worked . 

kindly mark my answer as correct and close this thread

if you have further question , kindly open new thread .

 

 

View solution in original post

18 REPLIES 18

Please check my Screen shot.

 

find_real_file.png

 

 

can you remove the condition and then try

 

Data policy will application when you will not have any value in account, so initially you get an error because you had not any value in account then data policy get triggered , in second hit you had value in account then data policy did not apply so kindly remove the condition 

Its Working now after removing account condition.

 

#1.What to do to get errors like  Maximum length exceeded,Invalid data with REST API.  Is this possible to get specific error in API response?.If yes Please tell How to achieve this?

#2.Also is there any possible to add fields in bulk like, all fields in a table or all fields in a view  to data policy .Since the user  may have 30 fields in one table(contact) and 20 fields in another table .Adding each field to data policy will take more time.

Please confirm this.

 

 

 

glad it worked . 

kindly mark my answer as correct and close this thread

if you have further question , kindly open new thread .