-
Notifications
You must be signed in to change notification settings - Fork 781
User resources
cosenary edited this page Aug 21, 2012
·
14 revisions
public access
,restricted access
getUser($id) // returns info according to a user id [public]
getUser() // returns info of the authenticated user [restricted]
Example response:
{
"data": {
"id": "1574083",
"username": "snoopdogg",
"first_name": "Snoop",
"last_name": "Dogg",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1574083_75sq_1295469061.jpg",
"bio": "This is my bio",
"website": "http://snoopdogg.com",
"counts": {
"media": 1320,
"follows": 420,
"followed_by": 3410
}
}
}
public access
searchUser($name)
Example response:
{
"data": [{
"username": "jack",
"first_name": "Jack",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_66_75sq.jpg",
"id": "66",
"last_name": "Dorsey"
},
{
"username": "sammyjack",
"first_name": "Sammy",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_29648_75sq_1294520029.jpg",
"id": "29648",
"last_name": "Jack"
},
{
"username": "jacktiddy",
"first_name": "Jack",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_13096_75sq_1286441317.jpg",
"id": "13096",
"last_name": "Tiddy"
}]
}
restricted access
getUserFeed()
Example response:
{
"data": [{
"location": {
"id": "833",
"latitude": 37.77956816727314,
"longitude": -122.41387367248539,
"name": "Civic Center BART"
},
"comments": {
"count": 16,
"data": [ ... ]
},
"caption": null,
"link": "http://instagr.am/p/BXsFz/",
"likes": {
"count": 190,
"data": [{
"username": "shayne",
"full_name": "Shayne Sweeney",
"id": "20",
"profile_picture": "..."
}, {...subset of likers...}]
},
"created_time": "1296748524",
"images": {
"low_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_6.jpg",
"width": 306,
"height": 306
},
"thumbnail": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_5.jpg",
"width": 150,
"height": 150
},
"standard_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_7.jpg",
"width": 612,
"height": 612
}
},
"type": "image",
"filter": "Earlybird",
"tags": [],
"id": "22987123",
"user": {
"username": "kevin",
"full_name": "Kevin S",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
"id": "3"
}
}]
}
restricted access
getUserLikes()
Example response:
{
"data": [{
"location": {
"id": "833",
"latitude": 37.77956816727314,
"longitude": -122.41387367248539,
"name": "Civic Center BART"
},
"comments": {
"count": 16,
"data": [ ... ]
},
"caption": null,
"link": "http://instagr.am/p/BXsFz/",
"likes": {
"count": 190,
"data": [{
"username": "shayne",
"full_name": "Shayne Sweeney",
"id": "20",
"profile_picture": "..."
}, {...subset of likers...}]
},
"created_time": "1296748524",
"images": {
"low_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_6.jpg",
"width": 306,
"height": 306
},
"thumbnail": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_5.jpg",
"width": 150,
"height": 150
},
"standard_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/03/efc502667a554329b52d9a6bab35b24a_7.jpg",
"width": 612,
"height": 612
}
},
"type": "image",
"filter": "Earlybird",
"tags": [],
"id": "22987123",
"user": {
"username": "kevin",
"full_name": "Kevin S",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
"id": "3"
}
}]
}
restricted access
getUserMedia($id)
Example response:
{
"data": [{
"comments": {
"data": [],
"count": 0
},
"caption": {
"created_time": "1296710352",
"text": "Inside le truc #foodtruck",
"from": {
"username": "kevin",
"full_name": "Kevin Systrom",
"type": "user",
"id": "3"
},
"id": "26621408"
},
"likes": {
"count": 15,
"data": [{
"username": "mikeyk",
"full_name": "Mike Krieger",
"id": "4",
"profile_picture": "..."
}, {...subset of likers...}]
},
"link": "http://instagr.am/p/BWrVZ/",
"user": {
"username": "kevin",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
"id": "3"
},
"created_time": "1296710327",
"images": {
"low_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_6.jpg",
"width": 306,
"height": 306
},
"thumbnail": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_5.jpg",
"width": 150,
"height": 150
},
"standard_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_7.jpg",
"width": 612,
"height": 612
}
},
"type": "image",
"filter": "Earlybird",
"tags": ["foodtruck"],
"id": "22721881",
"location": {
"latitude": 37.778720183610183,
"longitude": -122.3962783813477,
"id": "520640",
"street_address": "",
"name": "Le Truc"
}
}]
}
Public user methods
These methods require only a client_id
, so you can setup the class with:
new Instagram('YOUR_APP_KEY')
Restricted user methods
Methods with this label require an authenticated user with an access_token
. For more informations have a look at the Get started guide, especially the Authenticate user (OAuth2) chapter.