relationships resource endpoint
URL: /users/<id>/relationships.<format>
Supported Methods
| GET | Get a list of relationships that the selected user has with other users, and that other users have with the selected user. |
Query String Arguments
- start-index
- Index of the first item to return. The first item in the list has index 1.
- max-results
- Maximum number of items to return in the list response.
Resource Type
This endpoint returns an object of type List<Relationship>.
- entries (array<Relationship>)
- The items within the selected range.
- totalResults (integer)
- The total number of items in the whole list of which this object is a chunk.
Client Library Methods for PHP
- Get a list of relationships that the selected user has with other users, and that other users have with the selected user.
$tp->users->getRelationships(array( # Required Parameters "id" => $id, # Optional Parameters "limit" => $limit, "offset" => $offset, ))
Filter Endpoints
The following endpoints provide filtered views of this collection:
| follower | Get a list of relationships that have the Contact type that the selected user has with other users. |
| by-group | Get a list of relationships that the selected user has with other users, and that other users have with the selected user, constrained to members of a particular group. |
| by-user | Get a list of relationships that the selected user has with a single other user. |
| following | Get a list of relationships that have the Contact type that other users have with the selected user. |
Example Request
GET /users/6p012877b13de7970c/relationships.json?max-results=4 HTTP/1.1
Host: api.typepad.com
HTTP/1.0 200 OK
Content-type: application/json
Content-length: 4138
{
"entries": [
{
"source": {
"urlId": "6p012877b13de7970c",
"location": null,
"interests": [],
"objectTypes": [
"tag:api.typepad.com,2009:User"
],
"profilePageUrl": "http://profile.typepad.com/loblawatlaw",
"aboutMe": null,
"objectType": "User",
"preferredUsername": "loblawatlaw",
"id": "tag:api.typepad.com,2009:6p012877b13de7970c",
"avatarLink": {
"width": 73,
"url": "http://a0.twimg.com/sticky/default_profile_images/default_profile_2_bigger.png",
"height": 73
},
"displayName": "Bob Loblaw"
},
"created": {
"tag:api.typepad.com,2009:Contact": "2010-02-18T07:54:56Z"
},
"urlId": "6r012877b13de7970c00d83451c82369e2",
"target": {
"urlId": "6p00d83451c82369e2",
"location": "San Francisco, Tokyo, New York City, Paris",
"interests": [
"design",
"media",
"blogs",
"fun"
],
"objectTypes": [
"tag:api.typepad.com,2009:User"
],
"profilePageUrl": "http://profile.typepad.com/typepadeverything",
"aboutMe": "Typepad loves you.",
"objectType": "User",
"preferredUsername": "typepadeverything",
"id": "tag:api.typepad.com,2009:6p00d83451c82369e2",
"avatarLink": {
"width": 250,
"urlTemplate": "http://up3.typepad.com/6a00d83451c82369e20168ebba2aa0970c-{spec}",
"url": "http://up3.typepad.com/6a00d83451c82369e20168ebba2aa0970c-pi",
"height": 250
},
"displayName": "The Typepad Team"
},
"status": {
"types": [
"tag:api.typepad.com,2009:Contact"
]
},
"id": "tag:api.typepad.com,2009:6r012877b13de7970c00d83451c82369e2"
},
{
"source": {
"urlId": "6p0120a8ae8949970b",
"location": null,
"interests": [],
"objectTypes": [
"tag:api.typepad.com,2009:User"
],
"profilePageUrl": "http://profile.typepad.com/matkinsdevin",
"aboutMe": null,
"objectType": "User",
"preferredUsername": "matkinsdevin",
"id": "tag:api.typepad.com,2009:6p0120a8ae8949970b",
"avatarLink": {
"width": 250,
"urlTemplate": "http://static.typepad.com/.shared:vf3abf28:typepad:en_us/default-userpics/08-{spec}.gif",
"url": "http://static.typepad.com/.shared:vf3abf28:typepad:en_us/default-userpics/08-250si.gif",
"height": 250
},
"displayName": "Devin Jineer"
},
"created": {
"tag:api.typepad.com,2009:Contact": "2010-02-18T08:18:28Z"
},
"urlId": "6r0120a8ae8949970b012877b13de7970c",
"target": {
"urlId": "6p012877b13de7970c",
"location": null,
"interests": [],
"objectTypes": [
"tag:api.typepad.com,2009:User"
],
"profilePageUrl": "http://profile.typepad.com/loblawatlaw",
"aboutMe": null,
"objectType": "User",
"preferredUsername": "loblawatlaw",
"id": "tag:api.typepad.com,2009:6p012877b13de7970c",
"avatarLink": {
"width": 73,
"url": "http://a0.twimg.com/sticky/default_profile_images/default_profile_2_bigger.png",
"height": 73
},
"displayName": "Bob Loblaw"
},
"status": {
"types": [
"tag:api.typepad.com,2009:Contact"
]
},
"id": "tag:api.typepad.com,2009:6r0120a8ae8949970b012877b13de7970c"
}
],
"totalResults": 2
}