Joins are the relationship data objects have to each other. Join information is accessible and editable via REST.
Important
All requests require a Session ID URL parameter and basic request headers. In the following document, headers are omitted for clarity.
Joins are represented as JSON objects with the following properties:
| Name | Type | Writable | Description |
|---|---|---|---|
| Id | string | no | The unique Id of this join |
| EntityFrom | string | required-create | The “from” (or “left”) data object of this join |
| EntityTo | string | required-create | The “to” (or “right”) data object of this join |
| JoinType | const | yes (“Inner”) | Join Type |
| RelationshipType | const | yes (“OneToOne”) | Join Relation Type |
| Weight | integer | yes (0) | The weight of this join |
| JoinColumns | array of JoinColumn | required | The data fields which are joined |
{"Id": "Shippers.Orders","EntityFrom": "Shippers","EntityTo": "Orders","JoinType": "Inner","RelationshipType": "OneToMany","Weight": 0,"JoinColumns": [{"ColumnFrom": "ShipperID","ColumnTo": "ShipVia"}]}
The JoinColumn objects of a join indicate which columns are used to join the data objects. Objects can be joined on multiple join columns (which are AND-ed). Each join requires one or more sets of join columns.
JoinColumn objects have the following properties:
| Name | Type | Writable | Description |
|---|---|---|---|
| ColumnFrom | string | required | The join data field for the “from” (or “left”) data object |
| ColumnTo | string | required | The join data field for the “to” (or “right”) data object |
"JoinColumns": [{"ColumnFrom": "ShipperID","ColumnTo": "ShipVia"}]
GET /rest/Joins
List all the joins in the current configuration. Output is an array of objects, each representing an individual join.
| Name | Type | Description |
|---|---|---|
| Id | string | The unique Id of this join |
| Name | Type | Description |
|---|---|---|
| entity | string | Show only joins that join this data object |
curl http://{webservice}/rest/Joins?sid={sid} -X GET
Status: 200 OK
[
{
"Id": "Employees.Orders"
},
{
"Id": "Employees.EmployeeTerritories"
},
...
]
Show the properties of the join specified by its Id.
GET /rest/Joins/{Id}
curl http://{webservice}/rest/Joins/{Id}?sid={sid} -X GET
Status: 200 OK
{
"Id": "Orders.OrderDetails",
"EntityFrom": "Orders",
"EntityTo": "OrderDetails",
"JoinType": "Inner",
"RelationshipType": "OneToOne",
"Weight": 0,
"JoinColumns": [
{
"ColumnFrom": "OrderID",
"ColumnTo": "OrderID"
}
]
}
POST /rest/Joins
curl http://{webservice}/rest/Joins?sid={sid} -X POST ^
-d @newJoin.txt
{"EntityFrom":"Shippers","EntityTo":"Orders","RelationshipType":"OneToMany","JoinColumns":[{"ColumnFrom":"ShipperID","ColumnTo":"ShipVia"}]}
Status: 201 Created
{
"Id": "Shippers.Orders",
"EntityFrom": "Shippers",
"EntityTo": "Orders",
"JoinType": "Inner",
"RelationshipType": "OneToMany",
"Weight": 0,
"JoinColumns": [
{
"ColumnFrom": "ShipperID",
"ColumnTo": "ShipVia"
}
]
}
PATCH /rest/Joins/{Id}
Only supply the properties to be edited.
curl http://{webservice}/rest/Joins/{Id}?sid={sid} -X PATCH ^
-d "{'JoinType':'LeftOuter'}"
Status: 204 No Content
DELETE /rest/Joins/{Id}
curl http://{webservice}/rest/Joins/{Id}?sid={sid} -X DELETE
Status: 204 No Content