Exago Logo
Search
Generic filters
Exact matches only

REST – Data Joins

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.

Join JSON

Joins are represented as JSON objects with the following properties:

NameTypeWriteableDescription
IdstringnoThe unique Id of this join
EntityFromstringrequired-createThe “from” (or “left”) data object of this join
EntityTostringrequired-createThe “to” (or “right”) data object of this join
JoinTypeconstyes (“Inner”)Join Type
RelationshipTypeconstyes (“OneToOne”)Join Relation Type
Weightintegeryes (0)The weight of this join
JoinColumnsarray of JoinColumnrequiredThe data fields which are joined

Example

{
  "Id":               "Shippers.Orders",
  "EntityFrom":       "Shippers",
  "EntityTo":         "Orders",
  "JoinType":         "Inner",
  "RelationshipType": "OneToMany",
  "Weight":           0,
  "JoinColumns": [
    {
      "ColumnFrom": "ShipperID",
      "ColumnTo":   "ShipVia"
    }
  ]
}

JoinColumn JSON

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:

NameTypeWriteableDescription
ColumnFromstringrequiredThe join data field for the “from” (or “left”) data object
ColumnTostringrequiredThe join data field for the “to” (or “right”) data object

Example

"JoinColumns": [
  {
    "ColumnFrom": "ShipperID",
    "ColumnTo":   "ShipVia"
  }
]

List Joins

GET /rest/Joins

List all the joins in the current configuration. Output is an array of objects, each representing an individual join.

NameTypeDescription
IdstringThe unique Id of this join

Available parameters

NameTypeDescription
entitystringShow only joins that join this data object

Using curl

curl http://{webservice}/rest/Joins?sid={sid} -X GET

Example response

Status: 200 OK

[
  {
    "Id": "Employees.Orders"
  },
  {
    "Id": "Employees.EmployeeTerritories"
  },
  ...
]

Show Join

GET /rest/Joins/{Id}

Show the properties of the join specified by its Id.

Using curl

curl http://{webservice}/rest/Joins/{Id}?sid={sid} -X GET

Example response

Status: 200 OK

{
  "Id":               "Orders.OrderDetails",
  "EntityFrom":       "Orders",
  "EntityTo":         "OrderDetails",
  "JoinType":         "Inner",
  "RelationshipType": "OneToOne",
  "Weight":           0,
  "JoinColumns": [
    {
      "ColumnFrom": "OrderID",
      "ColumnTo":   "OrderID"
    }
  ]
}

Create Join

POST /rest/Joins

Using curl

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'}]}"

Example response

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"
    }
  ]
}

Edit Join

PATCH /rest/Joins/{Id}

Only supply the properties to be edited.

Using curl

curl http://{webservice}/rest/Joins/{Id}?sid={sid} -X PATCH ^
	-d "{'JoinType':'LeftOuter'}"

Example response

Status: 204 No Content

Delete Join

DELETE /rest/Joins/{Id}

Using curl

curl http://{webservice}/rest/Joins/{Id}?sid={sid} -X DELETE

Example response

Status: 204 No Content
Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents