Related Items

Description

Gets all the related items of a certain relationship type 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.

Request Parameters

Parameter

Details

[Common Parameters]

For a complete listing, see Common parameters.

relationshipType

The type of relationship between the two items. See Relationship types for a complete listing of types.

direction

The direction of the relationship. Either forward (from origin -> destination) or reverse (from destination -> origin).

Response Properties

Property

Details

total

The number of items related using the provided relationship type.

relatedItems

A JSON array of related item objects. See Item for the possible response properties for each item.

Example Usage

URL for Related Items

http://www.arcgis.com/sharing/rest/content/items/a40fddbcd3fc4fadbbb50485a50c3ed0/relatedItems?relationshipType=WMA2Code&direction=forward
Relationship Type=WMA2Code
Relationship Direction=forward

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

7/27/2017