How to get the poster of a publication? - facebook4j

Actually, i'm getting the post_id of a facebook's post, and i'm searching to get the page who posts it. Does the functions "getParentId" return it?

According to the Facebook API documentation, the parent_id is "the ID of a parent post for this post, if it exists." As such, it's not what you're looking for.
You can get the id of the page to which a post belongs via facebook4j's getFrom method.
Graph explorer example:
postId=5281959998_10151166683754999
GET /v2.9/$postId?fields=from
{
"from": {
"name": "The New York Times",
"id": "5281959998"
},
"id": "5281959998_10151166683754999"
}

Related

Google People API notes field

I'd like to know how to get the 'notes' field from the Google people API. There's no equivalent in documentation. I tried "biographies" but that didn't return any notes when I called the API for names, emails, etc.
I've seen this question asked a few years ago but I know the API has changed a bit and was hoping someone knows the answer.
Thanks!
Answer
The biographies field still representing the notes
How to check it?
Create a contact setting the notes with a concrete string, i.e. Hey, I'am a note
Call people.connections.list
resourceName = people/me
personFields = names
Get the resourceName to use it later
Call people.get
resourceName = resource from point 3
personFields = biographies
Check the biographies field, it will look something like:
"biographies": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "randomId"
}
},
"value": "Hey, I'am a note",
"contentType": "TEXT_PLAIN"
}
References
people.connections.list
people.get

Google Classroom How To Post Image

How can I post an image or simple text on the Google Classroom with python (with or without API)?
I've tried to see reference but didn't find anything with python.
Here you can see the documentation. You must inform path parameter courseId and body, something like that:
{
"materials": [
{
"youtubeVideo": {
"id": "w4TJmrOVas4"
}
}
],
"text": "Students: see link for my new neurohealth class."
}

How to returns all public tweets regarding for specific location using tweeter api

Is there an API call which will returns all recent public tweets regarding for specific location?
I tried GET trends/place but it's WOEID not worked for Sri Lanka and Cities.
(Sri Lanka WOEID is 23424778)
I don't want to use tweeter GET search/tweets.json endpoint because search based on certain key words.
Is there any solution for this?
Finally, I got the answer. We could not get trends on each and every location using tweeter API 1.1.
you have to check our closest trending place using this API call. For Austalia
https://api.twitter.com/1.1/trends/closest.json?lat=37.781157&long=-122.400612831116
the response like be this.
[
{
"country": "Australia",
"countryCode": "AU",
"name": "Australia",
"parentid": 1,
"placeType": {
"code": 12,
"name": "Country"
},
"url": "http://where.yahooapis.com/v1/place/23424748",
"woeid": 23424748
}
]
after that, you can use GET trends/place.
even though you cannot use GET trends/place for geo-based filtering you can use tweeter search endpoint. if you do not want to filter it by keyword ignore the q parameter and use geocodeparameter. for example,
https://api.twitter.com/1.1/search/tweets.json?result_type=recent&geocode=5.954920,80.554956,12mi
In here mi is miles.

mailchimp api v.3 can't insert template_id on post campaigns

post campaigns
{
"type" :"regular",
"recipients": {
"list_id": "0270xxxcf7"
}
,
"settings": {
"subject_line": "Thank you for your reservation",
"from_name": "Customer Service",
"reply_to": "reception#xxxx.com",
"template_id": 37125
}
}
every time the response is with ["template_id"]=>int(0)
I tried with php script and directly from "Developer Playground"... I got the same response.
Seems it's not possible to set the template id when you create a new campaign.
If I setup template_id: '37125' I receive this error:
template_id must to be integer
I tried with intval(37125)....nothing, I got the same ["template_id"]=>int(0) response.
Can somebody help me with this issue?
You have to use the "Set campaign content" option
/campaigns/{campaign_id}/content

Google place api - application specific search

I am trying to do application specific places search with google place api. Here is how I am adding a place:
Request:
{
"location": {
"lat": 37.760538,
"lng": -121.900879
},
"accuracy": 50,
"name": "p2p",
"types": ["other"]
}
I get success response as shown below:
Response:
{
"id" : "dfe583b1ac058750cf524f958afc5e82ade455d7",
"place_id" : "qgYvCi0wMDAwMDBhNWE4OWU4NTMzOjgwOGZlZTBhNjI3OjBjNTU1OTU4M2Q2NDI5YmM",
"reference" : "CkQxAAAAsPE72V-jhHUjj6vPy2HdC__2MhAdXanL6mlFBA4bcayRabKyMlfKFiah7U2vkoCj1P_0w9ESFSv5mfDkyufaZhIQTHBHY_jPGRHEE3EmEAGElhoUXTSylMslwHSTK5tYdstW2rOZKbw",
"scope" : "APP",
"status" : "OK"
}
When I search for this place using radar search, I get ZERO_RESULTS.
Request:
https://maps.googleapis.com/maps/api/place/radarsearch/json?key=key&radius=5000&location=37.761926,-121.891856&keyword=p2p
Response:
{
"html_attributions": [ ],
"results": [ ],
"status": "ZERO_RESULTS"
}
Is there something that I am doing the right way? Please help.
Thanks & Regards,
--Rajani
Your scope is "APP". That means you can access it (via PlaceID) from the application that created the entry only. If the location passes Google's moderation process, then it will gain scope "GOOGLE" and be accessible from the general searches.
scope — Indicates the scope of the place_id. The possible values are:
APP: The place ID is recognised by your application only. This is because your
application added the place, and the place has not yet
passed the moderation process.
GOOGLE: The place ID is available to other applications and on Google Maps.
Note: The scope field is included only in Nearby Search results and
Place Details results. You can only retrieve app-scoped places via the
Nearby Search and the Place Details requests. If the scope field is
not present in a response, it is safe to assume the scope is GOOGLE.
See: https://developers.google.com/places/documentation/search

Resources