The DELETED service is used to extrapolate the list of deleted records. You can in fact query the cloud system, indicating a specific table, to obtain a list of all the deleted records in it or the list of only the records that are deleted from a specific date/time.


The service in question can be called up via the following URL: https://api.gooseapp.com/deleted/


The JSON data structure must be sent by POST, below is an example of a call JSON:

{
code: "DEV001",
key: "09mpada9nx4mxl3346055518sf89hcyga74mwmhucgf9j7cg78",
table: "CON_TRO"
}


This call returns a JSON containing all the records found in the CON_TRO table.

The parameters available for the SELECT calls are as follows:

Name


Type


Mandatory


Description


code


varchar(6)


Yes


Company code


key


varchar(200)


Yes


Secure API Key


table


varchar(7)


Yes


Table name


from


varchar(50)


No


Date/time format "yyyy-mm-dd hh:mm:ss" that allows you to request only the records that have been deleted from a certain period onward.


Alternatively, you can use the "latest" keyword to have only the list of records deleted on a given table since the last successful call.


imc


true/false


No


The imc parameter stands for "Include My Call".


This parameter is only considered if the from parameter is also given a value, with a valid date/time format or with "latest" value.


If it is set to true, all deleted records are provided, including those deleted by one’s service or otherwise excluded.



The from parameter is essential if you wish to perform incremental sync operations and may be used in the date/time format as well as with the "latest" keyword.

A call like the following, in fact, allows you to obtain the list of all records deleted since the last call of your service.

{
 code: "DEV001",
 key: "09mpada9nx4mxl3346055518sf89hcyga74mwmhucgf9j7cg78",
 table: "CON_TRO",
 from: "latest"
}


If instead, you wish to omit the records deleted from the API service:

{
 code: "DEV001",
 key: "09mpada9nx4mxl3346055518sf89hcyga74mwmhucgf9j7cg78",
 table: "CON_TRO",
 from: "latest",
 imc: false
}


If the operation performed is successful you will obtain the following JSON:

{
 status: "OK",
 result:
 {
  total: 3,
  data: 
  [
   {
    TABLE: "CON_TRO",
    RECORD_ID: "0-1",
    SYKEY: ""
   },
   {
    TABLE: "CON_TRO",
    RECORD_ID: "0-2",
    SYKEY: "MyCode2"
   },
   {
    TABLE: "CON_TRO",
    RECORD_ID: "0-3",
    SYKEY: "MyCode3"
   }
  ]
 }
} 


The "OK" status indicates that the DELETED operation was successful. The result structure then contains the total (total selected rows) and data fields (return data structure).

If the operation performed is not successful you will obtain the following JSON:


{
 status: "error",
 error: 
 {
   code: 120,
   description: "Table 'client_goose_DEM001.CON_TRO' doesn't exist'"
 }
}


In case of an error, the status is shown with an "error" value and the error code and a description of the error are indicated in the error structure.


Do you want to ask us something?
Contact us at support@gooseapp.com