Bulk Create and Update links

post/links/bulk
Internal-Use Only

Creates and Updates internal links in bulk. The input is a list of link objects. Each link represents either a Create or Update operation, depending on its form. The output is a list of operation summary results. The input for the request is a SAS collection, which looks like the following:

{
  "items":[...]
}

Each element in "items" represents a series of records to be inserted or updated. If a specified record includes a link id, then it is treated as an Update operation. Otherwise, it is a Create operation. All Create and Update operations are processed internally by the server. The response from the request is another SAS collection with summary results for each item that was sent. Result items are in the same order as the input collection. If there is a problem, there will be an "error" property in the results for the item that had issues. If some items return errors, it does not prevent other valid records from being successfully processed.

Request Samples

1

Response Samples

1{
2 "links": [],
3 "name": "links",
4 "count": 2,
5 "items": [
6 {
7 "id": "primary_victim|_|police_report|_|person|_|id_600",
8 "relationshipTypeName": "primary_victim",
9 "fromId": "id_600",
10 "fromEntityType": "police_report",
11 "toId": "id_104",
12 "toEntityType": "person",
13 "operation": "UPDATE"
14 },
15 {
16 "error": {
17 "errorCode": 0,
18 "message": "The entity type with name \"TestChild\" was not found or the current user does not have the necessary permissions to view the entity type.",
19 "details": [
20 "From Entity Type: TestChild",
21 "From Entity ID: 3cf75c6d-439a-4b74-ac9f-ca2b5eb80c18",
22 "To Entity Type: Case",
23 "To Entity ID: 106f65d1-73be-4b7e-a78d-a33d38dbf057",
24 "Relationship Type Name: case_rev"
25 ],
26 "id": "DH6106",
27 "version": 2,
28 "httpStatusCode": 404
29 }
30 }
31 ],
32 "version": 2
33}

Request Body

This is a base schema that is used to define paginated collections of resources. It is based on http://{SAS API Portal}/reference/schema/baseCollection/v2/baseCollection2.json. Other APIs can extend this base schema by adding an "items" array property.

NameTypeRequiredDescription
name
string
false

The name of the collection.

start
integer<int64>
false

The zero-based index of the first item in the collection.

limit
integer
false

The number of items that were requested for the collection.

count
integer<int64>
false

If populated, indicates the number of items in the collection.

accept
string
false

A space-delimited list of media types from which an Accept header can be constructed.

links
array [SAS Link]
false

The links that apply to the collection.

version
integer
false

The version number of the collection representation. This representation is version 2.

Responses

StatusMeaningDescription
200OKLinks were created or updated. See items in the collection to determine whether the operation for an individual link succeeded or failed. Schema
400Bad RequestThe request was invalid.Schema