Manuais
PHC GO Save instance of Object
 

Method


The method to be called is:

  • saveInstance

  • This method can be used to insert, update and delete records from the PHC Go

  • The “operation” option on the itemVO should be used on the method to define what we want to do. Check the type of operations allowed in this table.



Parameters


In the request headers the Authorization header must have the Access Token:

  • Authorization: {{accessToken}}


JSON body


In the body of the POST a JSON structure like this one has to be passed:

{
"entity": "entityName",
"ndoc": 1,
"itemVO": {}
}

 

Return Information


Any call made to this method will return a JSON information with this structure:

  1. In case of success”:


    {
    "code": 1,
    "message": "Record saved with sucess - stamp:XX-XX-XX"
    }


  2. In case of error:


    {
    "code": 100,
    "message": "Error message"
    }



JSON Specification for Save instance of Object



NameTypeObservations
entityStringRequired, must me the table name of entity for example: Cl, Ft, Re, etc

If the request is an addon table, must be passed like this: uXXXX_table_name
ndocIntegerOptional, it is necessary only if entity requested uses document types, like invoices, receipts, etc
itemVOObjectRequired. The object passed to this property is a copy of the one acquired on /getNew, but with all the changes made by the implementation to be saved in record


Operation Type


This field on the ItemVO structure defines what we want to do for this record. we can insert, update and delete a existing record.
 
Operation TypeDescription
1Insert Record
2Update Record
3Delete Record