Was this helpful?

Use the GET method with a query to retrieve a user’s connections. By including query parameters, you can further filter the response. Standard querying methods and filters can be applied to users. See Queries and parameters for details on options for querying or filtering. By default, a maximum of 10 entities is returned at once.

Request URI

GET /{org_id}/{app_id}/users/{uuid|username}/{relationship}?{query}

Parameters

Parameter Description
arg uuid | string org_id Organization UUID or organization name
arg uuid | string app_id Application UUID or application name
arg uuid | string username Entity UUID or username
arg string relationship Collection name or connection type (e.g., likes)
optparam string query Query in the query language. See Queries and parameters.

Example - Request

curl -X GET "https://api.usergrid.com/my-org/my-app/users/jane.doe/likes?ql=select%20*%20where%20city%3D'milwaukee'"

The example assumes use of the JavaScript (HTML5) SDK.

var options = {
    method:'GET',
    endpoint:'users/jane.doe/likes',
    qs:{'ql':"select * where city='milwaukee'"}
};
client.request(options, function (err, data) {
    if (err) {
        //error — GET failed
    } else {
        //success — data will contain raw results from API call        
    }
});

The example assumes use of the Ruby SDK.

app = Usergrid::Application.new 'https://api.usergrid.com/my-org/my-app/'
app['users/jane.doe/likes'].query "select * where city = 'milwaukee'"

The example assumes use of the Node.js module.

var options = {
    method:'GET',
    endpoint:'users',
    users.qs = {'ql':"select * where city='milwaukee'"};
};
client.request(options, function (err, data) {
    if (err) {
        //error — GET failed
    } else {
        //success — data will contain raw results from API call        
    }
});

Example - Response

{
  "action": "get",
  "application": "3400ba10-cd0c-11e1-bcf7-12313d1c4491",
  "params":{
    "ql" : [ "select * where city='milwaukee'" ]
  },
  "path": "/users/ab225e6d-d503-11e1-b36a-12313b01d5c1/likes",
  "uri": "https://api.usergrid.com/22000a1c4e22-5ea08de5-4d23-11e1-b41d/3400ba10-cd0c-11e1-bcf7-12313d1c4491/users/ab225e6d-d503-11e1-b36a-12313b01d5c1/likes",
  "entities": [
    {
      "uuid": "895d7c11-5901-11e1-ac46-22000a1c5a67",
      "type": "restaurant",
      "created": 1329439893227,
      "modified": 1329439893227,
      "city": "milwaukee",
      "metadata": {
        "connecting": {
          "likes": "/users/ab225e6d-d503-11e1-b36a-12313b01d5c17/connecting/likes"
          },
          "connection": "likes",
          "cursor": "gGkAAQEAgHMACW1pbHdhdWtlZQCAdQAQiV18EVkBEeGsRiIAChxaZwCAcwAKcmVzdGF1cmFudACAdQAQUrM7mVkCEeGsRiIAChxaZwA",
          "associated": "42039286-c984-3b46-bbfb-28c4abb9b27c",
          "path": "/users/ab225e6d-d503-11e1-b36a-12313b01d5c1/likes/895d7c11-5901-11e1-ac46-22000a1c5a67"
      },
      "name": "Tulep"
    }
  ]
  "timestamp": 1315357451949,
  "duration": 52,
  "organization": "my-org",
  "applicationName": "my-app"
}

コメントを追加

Provide your email address if you wish to be contacted offline about your comment.
We will not display your email address as part of your comment.

We'd love your feedback and perspective! Please be as specific as possible.
Type the characters you see in this picture. (verify using audio)

Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.