vendredi 16 avril 2021

Defining operations in REST API

I am working on a message request which will have complete request details used to create a record in destination.

This integration create 3 different type of records (Order, shipment, invoice) at different times i.e. it will not always possible to create all at once, so I need to let the system know to create only certain requests.

My questions, what would be the best to way to add this information in request ?

  • Does it need to be in body of the request ?

     {
     "OrderNumber": "1234", 
     "operation": [
         "orderentry",
         "shipment",
         "invoice"
     ]
    

    }

  • Does it need to be in path ?

/Order/create?operation=orderentry

  • Does it need to be in seperate object ? say

     {
     "operation": [
         "orderentry",
         "shipment",
         "invoice"
     ],
     "request": {
         "OrderNumber": "1234", 
    
     }
    

    }

Aucun commentaire:

Enregistrer un commentaire