Joins are the relationship data objects have to each other. Join information is accessible and editable via REST.
Note. All requests require Session Id URL parameter and basic request headers. In the following examples, headers are omitted for clarity.
Joins are represented as JSON objects with the following properties:
Name | Type | Writeable | 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 | Writeable | 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"
},
...
]
GET /rest/joins/{Id}
Show the properties of the join specified by its 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
newJoin.txt
"{'EntityFrom':'Shippers','EntityTo':'Orders','RelationshipType':'OneToMany','JoinColumns':[{'ColumnFrom':'ShipperID','ColumnTo':'ShipVia'}]}"
Status: 201 Created
Location: /{webservice}/rest/Joins/Shippers.Orders
{ "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