- URL:
- https://[root]/content/items/[itemID]/relatedItems
- Methods:
GET
Example Usage
URL for Related Items
https://www.arcgis.com/sharing/rest/content/items/a40fddbcd3fc4fadbbb50485a50c3ed0/relatedItems?relationshipTypes=WMA2Code&direction=forward
Relationship Types=WMA2Code
Relationship Direction=forward
Description
The related
operation retrieves all the related items of a certain relationship type or multiple relationship types for that item. An optional direction can be specified if the direction of the relationship is ambiguous. Otherwise, the service will try to infer it.
Only default administrators and item owners have access to related items.
Request parameters
Parameter | Details |
---|---|
| For a complete listing, see Common parameters. |
| For a complete list of paging parameters, see Paging parameters. |
| Field to sort by. Supported sort field: |
| Applies when working with Values: |
| The direction of the relationship. Either forward (origin-to-destination) or reverse (destination-to-origin). This is required parameter. |
| The type of relationship between the two items. Example:
|
| Returns an item or a set of items from recycle bin. The default is Values: Example:
|
Response properties
Property | Details |
---|---|
| The following paging properties are included in the response and they are described in Paging properties.
|
| Used to fetch the next batch of events by calling with the |
| The number of items related using the provided relationship type. |
| A JSON array of related item objects. See Item for the possible response properties for each item. |
JSON Response syntax
{
"total": number of related items,
"relatedItems": [
{
"id": "item id",
"owner": "<owner username>",
"created": date created shown in UNIX time,
"modified": date modified shown in UNIX time,
"guid": unique lpk id,
"name": "<item name>",
"title": "<item title>",
"type": "<type>",
"typeKeywords": [
"<type keyword1>",
"<type keyword2>",
"<type keyword3>",
"<type keyword4>",
],
"description": <description>,
"tags": [
"<tag1>"
"<tag2>"
"<tag3>",
],
"snippet": <summary>,
"thumbnail": "<file name>",
"extent": [
[
minX,
minY
],
[
maxX,
maxY
]
],
"spatialReference": <coordinate reference>,
"accessInformation": <credits>,
"licenseInfo": <access and use constraints>,
"culture": <culture code>,
"url": <url>,
"access": "private | shared | org | public",
"size": <item size>,
"numComments": <number of comments>,
"numRatings": <number of ratings>,
"avgRating": <average rating>
"numViews": <number of views>
}
]
}
JSON Response example
{
"total": 1,
"relatedItems": [
{
"id": "9700ccd8df25439da8cd3b913e8aa469",
"owner": "jsmith",
"created": 1252983066000,
"modified": 1256666605000,
"guid": null,
"name": "Map Sample Code",
"title": "Map Sample Code",
"type": "Code Attachment",
"typeKeywords": [
"sample",
"map",
"code"
],
"description": "The code sample provides the information needed to create a web mapping application on your web site.",
"snippet": "Code sample for a mapping application.",
"thumbnail": "thumbnail/map_sample.png",
"extent": [
[
-180,
-90
],
[
180,
90
]
],
"spatialReference": null,
"accessInformation": null,
"licenseInfo": null,
"culture": en_us,
"url": null,
"access": "public",
"size": 78,
"numComments": 6,
"numRatings": 12,
"avgRating": 3,
"numViews": 56
}
]
}