Troubleshooter
I get a 401, not authenticated?
If you get a 401 response with the error message: "Authorization has been denied for this request", its most likely your JWT token that has expired or is invalid.
Please have a look at the authentication introduction.
Complex PUT?
Having trouble deleting or creating a subentity?
In Unimicro we support updating an entity with subentities. Subentities can be created, deleted and updated in a PUT operation.
To delete a subentity, set the "Delete" property to "true". To create a subentity, the entity must define the property "_createguid" which must contain a global unique identifier.
Why do we do this? This is implemented to ensure that the same database insert cannot happen twice. If the same subentity is saved twice, an error will occur.
Example: JSON for an order where two order lines are updated, two are deleted and the last two are created.
{
"ID": 712,
"CustomerName": "5f4f51d6-3f0b-4156-971d-106fd8d90de0",
"Lines": [
{
"ID": 797,
"Amount": 1000.0
},
{
"ID": 798,
"Amount": 1000.0
},
{
"ID": 799,
"Amount": 999.0,
"Deleted": true
},
{
"ID": 800,
"Amount": 999.0,
"Deleted": true
},
{
"ID": 0,
"Amount": 111.1,
"_createguid": "8da83feb-b714-4cbe-a9fe-35e4d29096de"
},
{
"ID": 0,
"Amount": 222.2,
"_createguid": "32174298-de1e-4333-b905-a4b759f3887e"
}
]
}