REST API - Allow for Batch request transactions

Idea created by mb23565 on Jun 7, 2017
    Under review
    Score0

    Hello,

     

    I would like to suggest an option to allow for Batch transaction for each endpoint. Currently, there is no way to send a JSON Array of items to a endpoint. Allowing for this Batch feature would allow end users to group the requests to a single endpoint to save on HTTP Requests. The fewer the better.

     

    Currently, only a single JSON Obj is expected:

     

    POST /learn/api/public/v1/dataSources Create Data Source

     

    {
      "externalId": "string",
      "description": "string"
    }
    

     

    Allowing for Batch would be

     

    POST /learn/api/public/v1/dataSources Create Data Source

     

    
    [
      {
        "externalId": "string",
        "description": "string"
      },  
      {
        "externalId": "string",
        "description": "string"
      },  
      {
        "externalId": "string",
        "description": "string"
      },
      ...
    ]
    
    
    

     

    Naturally having the return be the created objects with all requested fields.

     

    This opens up the PUT,PATCH methods as well.

     

    The alternate feature for DELETE and GET can be done by supply url query parameters as such:

     

    /api/path/plural?batch=idType:id,idType:id

     

    or maybe additional endpoints using POST with a specific JSON Obj structure

     

    
    {
      "action": "DELETE|GET",
      "filters":{
        ...may allow for filtering to be added here for complexity
      },
      "batch":[
      {
        "externalId": "string",
        "description": "string"
      },
      {
        "externalId": "string",
        "description": "string"
      },
      {
        "externalId": "string",
        "description": "string"
      },
      ...
    ]}
    
    
    Product Version (if applicable):