Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Update single object

This function is used for updating single data object in API- update has the same structure with insert, just change Http verb "POST" into "PUT"

a. Using HTTP

URL: { REST API Host } / app / { Winbooks OM } / { Code } / Folder/ { FolderCode } 
Method : POST
Header : 
    Authorization : Bearer {access_token}
    Content-Type : application/json
Body content : {object in json format}

...

b. Using Winbooks.Apis.Services


cosmoCustomer.Memo = "this is the memo property update for cosmoCustomer" ;
cosmoCustomer.MemoType = MemoType.Green;
folderRESTAPIDEMO.UpdateByCode<Customer>(cosmoCustomer, 1);

Update List of Objects

This function is used for updating list of objects in API

a. Using HTTP

URL : { REST API Host } / app / { Winbooks OMS } / Folder / { FolderCode }
Method : POST
Header :
   Authorization : Bearer {access_token}
   Content-Type : application/json
Body Content: { list of object need to be inserted in json format}

...


{
   "Method": "InsertOrUpdateList",
   "ObjectType": "Customer",
   "NumberOfSuccess": 3,
   "NumberOfFail": 0,
   "ListObjectFail": [],
   "ListUrlSuccess": [
     https://rapi.winbooksonweb.be/app/Customer/ARTHUR/Folder/PARFIWEB_DEMO",
     "https://rapi.winbooksonweb.be/app/Customer/ALPHA/Folder/PARFIWEB_DEMO",
     "https://rapi.winbooksonweb.be/app/Customer/AUBEPINES/Folder/PARFIWEB_DEMO"
   ],
   "ReasonFail": []
}

b. Using Winbooks.Apis.Services


foreach (var customer in lstCustomerBE)
{
     customer.Third.WebSite = "www." + customer.Third.Code.ToLower().Trim( ' ' ) + ".com" ;
}
folderPARFIWEB.UpdateCollection(lstCustomerBE, 2);

Top