We have 5 ways for deleting data in API :
- Delete by single Code
- Delete By ID
- Delete by List of Code
- Delete By Criteria
- Delete all data objects
A. Delete By Single Code
This function is used to delete a single object by giving its code.
a. Using HTTP
|
If the object is deleted successfully, a response with success status 200 code will be returned
The example below will delete a customer with code " VLADIMIR " in folder " PARFIWEB_DEMO "
URL: https://rapi.winbooksonweb.be/app/Customer/VLADIMIR/Folder/PARFIWEB_DEMO
Method : DELETE
Header :
Authorization : Bearer gAAAAEg9vKjrggECqOrp6bekZ0KO6_86-URgC5D1xYxXqexQyaOu_St ....
b. Using Winbooks.Apis.Services
Delete Customer By Code
|
B. Delete By ID
a. Using HTTP
The same as Delete By Single Code, just replay Code by ID
b. Using Winbooks.Apis.Services
Delete by Id
|
C. Delete By List of Codes
This function is used to delete a list of objects by giving a list of codes.
a. Using HTTP
|
If the object is deleted successfully, a response with success status 200 code will be returned and contains the list of objects deleted successfully and failed
The example below will delete a list of customer with code "VLADIMIR,TITAN,JIMMY,JORDAN,SPARKLES" in folder "PARFIWEB_DEMO"
URL : https://rapi.winbooksonweb.be/app/Customers/Folder/PARFIWEB_DEMO?code=VLADIMIR,TITAN,JIMMY,JORDAN,SPARKLES
Method : DELETE
Header :
Authorization : Bearer gAAAAEg9vKjrggECqOrp6bekZ0KO6_86-URgC5D1xYxXqexQyaOu_St ....
b. Using Winbooks.Apis.Services
|
D. Delete By Criteria
This function is used to delete a list of objects by giving a condition.
a. Using HTTP
|
** for getting criteria in json format, please take a look at function "Get By Criteria"
The example below will delete all Customers whose country code is "GB "
URL : https://rapi.winbooksonweb.be/app/Customers/Folder/PARFIWEB_DEMO/DeleteByCriteria
Method : POST
Header :
Authorization : Bearer gAAAAEg9vKjrggECqOrp6bekZ0KO6_86-URgC5D1xYxXqexQyaOu_St ....
Content : application/json
Accept : application/json
Body content : {"Alias":"this","Association":{"t":{"OwnerAlias":null,"AliasName":"t","Type":"Winbooks.TORM.OM.Third, Winbooks.TORM.OM, Version=1.66.3.0, Culture=neutral, PublicKeyToken=null","JoinType":1,"Properties": ["Id","Third_Id"],"Condition":null},"c":{"OwnerAlias":null,"AliasName":"c","Type":"Winbooks.TORM.OM.Country, Winbooks.TORM.OM, Version=1.66.3.0, Culture=neutral, PublicKeyToken=null","JoinType":1,"Properties": ["Id","t.VatCountry_Id"],"Condition":null}},"Conditions":[{"Operator":0,"PropertyName":"c.Code","OtherPropertyName":"","Values":["GB"]}],"ProjectionsList":[],"Orders":{},"Params":{},"FirstResult":-1,"MaxResult":-1}
b. Using Winbooks.Apis.Services
Delete By Criteria
|
E. Delete All Data Objects
This function is used to clear all data objects.
a. Using HTTP
|
b. Using Winbooks.Apis.Service
Delete All Customer
|