Hi,
I’m getting some annoyingly not-very-useful errors returned when trying to import a data record with a related opportunity.
Here it is:
[
{
"id":"1",
"links":{
"about":null
},
"status":400,
"code":8000,
"title":"JSON API Error",
"detail":"Please ensure you fill in the fields required",
"source":{
"pointer":null,
"parameter":null
},
"meta":{
"about":"Exception",
"class":"SuiteCRM\\API\\v8\\Exception\\BadRequestException",
"code":8000,
"langMessage":null
}
},
{
"property":"",
"pointer":"",
"message":"The property errors is not defined and the definition does not allow additional properties",
"constraint":"additionalProp",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"data",
"pointer":"\/data",
"message":"The property data is required",
"constraint":"required",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"errors[0].links.about",
"pointer":"\/errors\/0\/links\/about",
"message":"NULL value found, but an object is required",
"constraint":"type",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"errors[0].links.about",
"pointer":"\/errors\/0\/links\/about",
"message":"NULL value found, but a string is required",
"constraint":"type",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"errors[0].links.about",
"pointer":"\/errors\/0\/links\/about",
"message":"Failed to match exactly one schema",
"constraint":"oneOf",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"errors[0].status",
"pointer":"\/errors\/0\/status",
"message":"Integer value found, but a string is required",
"constraint":"type",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"errors[0].code",
"pointer":"\/errors\/0\/code",
"message":"Integer value found, but a string is required",
"constraint":"type",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"errors[0].source.pointer",
"pointer":"\/errors\/0\/source\/pointer",
"message":"NULL value found, but a string is required",
"constraint":"type",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"errors[0].source.parameter",
"pointer":"\/errors\/0\/source\/parameter",
"message":"NULL value found, but a string is required",
"constraint":"type",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
},
{
"property":"",
"pointer":"",
"message":"Failed to match exactly one schema",
"constraint":"oneOf",
"context":1,
"id":"1",
"links":{
"about":null
},
"status":"200",
"code":"1",
"title":"JSON API Error",
"detail":"JSON API Error occured.",
"source":{
"pointer":null,
"parameter":null
},
"meta":[
]
}
]
Sorry for posting the whole error log, but it might help to make sense of it.
Firstly, none of the fields are null; all are strings in the JSON packet.
Secondly, I’ve switched off all of the required fields in our UAT version.
What I’m trying to do is to migrate a contact record with an opportunity record. So I need to create the Contact and Opportunity together?
I am able to create each record separately.
Looking at the not-very-helpful documentation for the JSON API, I think I’ve got the JSON structure right when trying to import the record.
Could someone provide an example of creating a new contact record and opportunity record in SuiteCRM using the API and relating both so that I know where I’m going wrong.
Many thanks,
Shaun.