Control language of facebooks open graph responses - facebook

I'm trying to make a request to facebook-api.
My url looks like this:
https://graph.facebook.com/v2.8/XXX/events/attending/?fields=start_time&limit=100&locale=de_DE&access_token=XXX
The Result looks fine:
"data": [
{
"start_time": "2017-11-18T20:00:00+0100",
"id": "xxx"
},
{
"start_time": "2017-09-29T20:00:00+0200",
"place": {
"name": "xxx",
"location": {
"city": "Cologne",
"country": "Germany",
"latitude": x,
"longitude": x,
"street": "x",
"zip": "x"
},
"id": "xxx"
},
"id": "xxx"
}
The only Problem is, that the city names are in english. I need them in german.
As you can see i already tried adding the parameter "locale=de_DE" but this doesn't change anything..
Does anyone has an idea how to solve this?
I would be really greatful because I am searching for an answer for weeks now..

Related

Which fields are available for the &fields parameter in the Graph API /search endpoint?

I'm working with the Facebook Graph API and I was wondering which fields are available for the &fields parameter and also where do I find any documentation about those fields.
I could only find the Search types for the &type parameter in the documentation for example the page Search type let's you search for a page if you provide a name to be queried.
Example request
search?q=Facebook&type=page
Example response
{
"data": [
{
"category": "Computers/technology",
"name": "Facebook Engineering",
"id": "9445547199"
},
{
"category": "Product/service",
"name": "Facebook",
"id": "103274306376166"
},
{
"category": "Product/service",
"name": "Facebook Developers",
"id": "19292868552"
},
{
"category": "Media/news/publishing",
"name": "Facebook Stories",
"id": "114770288670819"
}
]
}
If I now need some specified fields from this collection I know from a previous experience that I could use the &fields parameter to extract them or filter them out.
Example request
search?q=Facebook&type=page&fields=name, likes, location
Example response
{
"data": [
{
"name": "Facebook NY",
"likes": 71564,
"location": {
"street": "770 Broadway",
"city": "New York",
"state": "NY",
"country": "United States",
"zip": "10003",
"latitude": 40.730901749524,
"longitude": -73.991377364328
},
"id": "28864583650"
},
{
"name": "Facebook London",
"likes": 56441,
"location": {
"street": "10 Brock Street",
"city": "London",
"state": "",
"country": "United Kingdom",
"zip": "NW1 3FG",
"latitude": 51.5258476,
"longitude": -0.1394228
},
"id": "265781023507354"
},
{
"name": "Facebook Paris",
"likes": 29740,
"location": {
"street": "",
"city": "Paris",
"state": "",
"country": "France",
"zip": "75017",
"latitude": 48.883443087419,
"longitude": 2.3023060392957
},
"id": "147424071942327"
}
]
}
I used the Graph API Explorer to do this
TLDR; is there a list or documentation available for all the options/specific fields in the &fields parameter?
Although there is no complete documentation, for any element you can query
{id}?metadata=1
this will give you a full list of fields and edges that are available for that object type (as well as its type at the very bottom)
sample call: https://graph.facebook.com/v2.8/me?metadata=1
There is no exact documentation on the search fields endpoint.
An educated guess would be that based on the type you can inspect the fields of that page.
Example, for type=page the fields available will be listed at https://developers.facebook.com/docs/graph-api/reference/v2.2/page

facebook api retrieving friends pictures who posted on wall

I am trying to create a Facebook wall using the objects from the users feed. However, what I cannot seem to do is get the picture of the friends who have posted on my wall.
I am currently using an if statement to check the feed object for the from property below. I can get the id from the from property, but that only allows me to get it if I do another api call within the loop to construct the wall. However, since it is async i cannot return the values, and I also can't concatenate it with the src attribute. Any suggestions on how to get around this problem?
{
"data": [
{
"id": "64582869534783990_343788612678878",
"from": {
"id": "32458397413435340",
"name": "User Name"
},
"message": "this is my message",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/144375679690/posts/245786252634978"
},
{
"name": "Like",
"link": "https://www.facebook.com/245786252634978/posts/245786252634978"
}
],
"privacy": {
"description": "Your friends",
"value": "ALL_FRIENDS",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "mobile_status_update",
"application": {
"name": "App Name",
"id": "245786252634978"
},
"created_time": "2014-11-08T22:26:06+0000",
"updated_time": "2014-11-08T22:26:06+0000"
}
]
}
Just use field expansion
me/feed?fields=from{id,name,picture}

What's the difference between a facebook post.id and status.id?

I am using the graph-api to walk information about a facebook user. In looking at the connections for the User node, both 'posts' and 'statuses' are available.
When walking through the posts, I come across posts of the type 'status' that have slightly different information, than the equivalent status message.
In the example below, you can see that they are the same message, but the "Post Version" has an id of "100002912416196_212493188857760" while the "Status Version" has an id of "212493188857760". Is one "more correct" than the other? Is Facebook in the process of moving from using statuses (and links, etc) to just using posts (or vice versa)? Any help someone could give would be appreciated.
Here's an example (edited to save space)
when called with https://graph.facebook.com/me/posts
"data": [
{
"id": "100002912416196_212493188857760",
"from": {
"name": "Ben Backup",
"id": "100002912416196" },
"to": {
"data": [{
"name": "Dave Upify",
"id": "100001917301370"
}] },
"message": "With Dave Upify",
...
"type": "status",
"created_time": "2012-03-20T20:18:54+0000",
"updated_time": "2012-03-20T20:18:54+0000",
"comments": {
"count": 0
},
"is_published": true
}
when called with https://graph.facebook.com/me/statuses
"data": [{
"id": "212493188857760",
"from": {
"name": "Ben Backup",
"id": "100002912416196" },
"message": "With Dave Upify",
"place": {
"id": "126533127390327",
"name": "Massachusetts Institute of Technology",
"location": {
"street": "77 Massachusetts Avenue",
"city": "Cambridge",
"state": "MA",
"country": "United States",
"zip": "02139",
"latitude": 42.359430693405,
"longitude": -71.092129185382
}
},
"updated_time": "2012-03-20T20:18:52+0000"
},

How to get Friends uid from tagged photo?

I can get names from field "text" of table "photo" but
I cant use those names to get uids.
How can I get uids of tagged people in photo??
all you have to do is query the graph api like this :
https://graph.facebook.com/{photo_id} and you will recieve the data you need...
{
"id": "{photo_id}",
"from": {
"name": "{user_that_uploaded_the_photo}",
"id": "123"
},
"tags": {
"data": [
{
"id": "123",
"name": "Lior",
"x": 48.5099,
"y": 37.5276,
"created_time": "2011-10-11T05:50:35+0000"
},
{
"id": "456",
"name": "Shlain",
"x": 19.0397,
"y": 35.3201,
"created_time": "2011-10-11T05:50:40+0000"
},
{
"id": "789",
"name": "Abigail",
"x": 76.8212,
"y": 47.4614,
"created_time": "2011-10-11T05:50:32+0000"
}
...
You can use the graph api explorer to experiment with these methods...
good luck!

iphone: parsing a string

Hey I have a response string in this format
ok my original resonse string is like this
{
"data": [
{
"name": "Santa Fe Plaza",
"category": "Landmark",
"location": {
"city": "Santa Fe",
"state": "NM",
"country": "United States",
"latitude": 35.687071155202,
"longitude": -105.93767717603
},
"id": "108196762542063"
},
{
"name": "Museum of Contemporary Native Arts",
"category": "Museum/art gallery",
"location": {
"street": "108 Cathedral Place",
"city": "Santa Fe",
"state": "NM",
"country": "United States",
"zip": "87501",
"latitude": 35.686915835451,
"longitude": -105.93725120129
},
"id": "106209180361"
}
]
}
I have to extract all the names from there Please enlighten me how to achieve this
JSON parser is throwing error all the time
Thanx in advance
Start by downloading the JSON framework
And a Good Tutorial to Start learning: JSON Framework for iPhone
Also see: How to parse JSON files on iPhone in Objective-C into NSArray and NSDictionary