Open simplimation opened 1 year ago
Here is the raw result of a query using the API Explorer that shows the EntityRef value and type:
select * from attachable where AttachableRef.EntityRef.Type = 'customer' and AttachableRef.EntityRef.value = '1'
"QueryResponse": {
"Attachable": [
{
"FileName": "Sample-1677623013.pdf",
"FileAccessUri": "/v3/company/4620816365162761880/download/5000000000001184365",
"TempDownloadUri": "https://intuit-qbo-prod-19.s3.amazonaws.com/4620816365162761880/attachments/46b44f48-df7a-45cb-8222-67b959b8cadcSample-1677623013.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230307T181435Z&X-Amz-SignedHeaders=host&X-Amz-Expires=900&X-Amz-Credential=AKIA3V3MBG4KEF3MXKGR%2F20230307%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=882f0c09cdba8cdd0e0a5ece7f63f59b29d69a02a1031e17804e30a5a7f2b1c1",
"Size": 2729,
"ContentType": "application/pdf",
"domain": "QBO",
"sparse": false,
"Id": "5000000000001184365",
"SyncToken": "0",
"MetaData": {
"CreateTime": "2023-02-28T14:23:35-08:00",
"LastUpdatedTime": "2023-02-28T14:23:35-08:00"
},
"AttachableRef": [
{
"EntityRef": {
"value": "1",
"type": "Customer"
},
"IncludeOnSend": false
}
]
},
...
This also causes requests updating Attachable objects to throw a business validation error "The entity
The XSD seems to have "Type" listed as an element, but it is being received as an attribute in the received XML
When querying Attachable objects, in the response the XML "type" attribute of EntityRef is not parse by DataService.php:1027 and so the IPPAttachable.AttachableRef.EntityRef.type is not defined. There is no way to see from the query results what type of object the EntityRef ID refers to. It parses the entity's ID but not the type.
Raw XML response ($responseBody at DataService:1019)
Parsed XML object ($responseXmlObj DataService: 1028)
IPPAttachable object ($parsedResponseBody DataService:1031)