-
Last updated
Mar 31, 2023
-
Save as PDF
Purpose
The Bundle endpoint is so that the end users can post multiple distinct requests at the same time. An example is if you need data from a number of endpoints for a single screen, instead of making each individual call you would bundle them together and make one request. This will save time and bandwidth.
Request
When sending a bundled request to the server, you will send an array of the same objects you would send in a singular request.
04 |
"Version"``: "2019.3"``, |
05 |
"SequenceNumber"``: 1``, |
06 |
"ResourceType"``: "ticket"``, |
09 |
"conditions"``: "summary like '%a%' and status/name like '%new%'and board/name='Help Desk'" |
18 |
"Version"``: "2019.2"``, |
19 |
"SequenceNumber"``: 1``, |
20 |
"ResourceType"``: "Company"``, |
23 |
"conditions"``: "companyName = 'Connectwise'"``, |
24 |
"childConditions"``: ""``, |
25 |
"customFieldConditions"``: "" |
37 |
"Version"``: "2019.2"``, |
38 |
"SequenceNumber"``: 2``, |
39 |
"ResourceName"``: "Member"``, |
43 |
"GrandParentId"``: 3``, |
45 |
"conditions"``: "memberName = 'John Smith'"``, |
46 |
"childConditions"``: ""``, |
47 |
"customFieldConditions"``: "" |
Example: Line Items from PO
This example is a GET on Line Items for purchase order 1. Note the ParentId specifies the purchase order recId.
05 |
"Version"``:``"2019.5"``, |
06 |
"SequenceNumber"``:``1``, |
07 |
"ResourceType"``:``"purchaseorderlineitem"``, |
11 |
"conditions"``:``""``, |
12 |
"childConditions" : ""``, |
13 |
"customFieldConditions"``: "" |
Response
The response object that is returned is slightly different from what they normally get back from the singular endpoints. This is because we need to track the success status of each object individually. Because of this, there will be a wrapper class around each returned object that will have status information.
Furthermore, since each record may have different statuses, we will respond with different status codes depending on what the outcomes are.
The wrapper will have 5 properties:
-
success: This property is a boolean that indicates if the response was a success or an error occurred
-
sequenceNumber: This is the sequence number passed in with the array. This is so you can map the returned object back to the original sent-in object so you can sync id’s and all other information
-
statusCode: This will be filled in with what the status code would have been if the user had called the individual endpoint (e.g. 200, 400, 403)
-
error: If success is false, this will be populated with the error response that you would have received if you called the individual endpoint; Else this will be null and not returned.
-
data: If success is true, this will be populated with the returned object as if the called the individual endpoint; Else this will be null and not returned
04 |
"sequenceNumber"``: 1``, |
05 |
"resourceType"``: "Company"``, |
08 |
"record"``: "Company1data" |
11 |
"record2"``: "Company2data" |
19 |
"sequenceNumber"``: 2``, |
20 |
"resouceType"``: "ServiceNote"``, |
23 |
"statusCode"``: 404``, |
25 |
"code"``: "NotFound"``, |
26 |
"message"``: "ServiceNote123notfound" |