I'm facebook graph API user.
Recently found that since parameter works weird.
I'm using that to find all upcoming events and filter out past events for a particular venue.
For instance:
When I use query like this
/v2.5/481931581856759/events?access_token=&limit=5
I getting all events.
But if I add since variable, some events are missing
/v2.5/481931581856759/events?access_token=&limit=5&since=1471468270
In this case can not find an event with start_time "2016-10-28T19:00:00-0700".
Why that happens or I misunderstand something?
Related
I am trying to update the "purchasable" flag on a product variation using REST API
/wp-json/wc/v3/products/<prodID>/variations/<varID>
I have tried sending a simple
{"purchasable":false}
as well as getting the current data for the variation, changing the "purchasable" entry to the new state, and submitting the entire data back to WooCommerce. In no case have I been able to change this value using REST API.
I am using jw-auth for authentication and have a proper token (I do receive a proper response back with all the data for the variation, but still with the old value of "purchasable" in it, so I know I'm communicating with the back-end).
Is there some setting elsewhere that needs to be set for me to be able to change this specific property? The variations have been created using REST API as well, and on the shop it works fine (I can pick the variations as expected).
What am I doing wrong? Or have I found a bug in WooCommerce? :-)
That field is listed as ReadOnly in the api docs. I believe Woo uses other criteria to set that value. In my research, it appears that setting the Stock Status to "outofstock" seems to be a common method for keeping an item from being purchased. Also, setting the price to null or empty.
https://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties
Earlier, this would give back a list of events:
clubversuz/events
Now it gives back an empty array called 'data'.
Ok..they say that now you should explicitly declare the fields in a request, so I tried that too with this, but it return nothing either. The clubversuz id is used below:
8261409764/events?fields=end_time,start_time,timezone,id,name
Does anyone know how to go further?
P.S. I just started with this API and yesterday I was glad: I could get events.
Now, one day later, it has been broken by changes from fb. Is this how it's going to be with the fb API, Create something, break, repair? :)
It seems that the behaviour is still working if you explicitly provide the API version to be v2.3:
https://graph.facebook.com/v2.3/8261409764/events?access_token=
When you use v2.4 in the above call, it's not returning any events. This might actually be a bug; can you create a bug report?
I am fetching a list of tracks from soundcloud's API using the following query to retrieve the 5 most popular tracks:
https://api.soundcloud.com/tracks?client_id=XXX&order=hotness&limit=5
But recently SoundCloud removed the hotness order. In the blog post they say tracks can instead be sorted by playback_count. But can this be done in the query or do they suggest I pull down the whole SoundCloud library and order them in the client? The following doesn't seem to work:
https://api.soundcloud.com/tracks?client_id=XXX&order=playback_count&limit=5
So how would one retrieve the top tracks on SoundCloud?
The solution was to use the undocumented calls for the explorer feature that SoundCloud itself uses (I used the dev tools in Chrome to check the AJAX calls).
https://api.soundcloud.com/explore/sounds/category?limit=L&client_id=XXX
This appears to use some sort of sorting on the popularity of the songs. The songs can then be filtered on only music by checking the "grouping" attribute. I then have to resolve the list of IDs to actual songs which can be done with the (documented, official) API call:
https://api.soundcloud.com/tracks?ids=1,2,3&client_id=XXX
This seems to work perfectly and I also get the added benefit of an even distribution among genres. But of course, this can stop working at any moment since the API calls are undocumented and perhaps not meant for public use.
Just wanted to provide an update. It seems soundcloud has moved to v2 of the explore API call.
Use this to get a list of categories:
https://api.soundcloud.com/explore/v2
And this to get tracks from a category:
https://api-v2.soundcloud.com/explore/metal?limit=10&offset=0
So far it seems to without a key, although I have no idea how long that will last.
EDIT: So the 2nd url doesn't seem to allow cross-origin, but so far this does work, though it only returns the trackID not the full information
https://api.soundcloud.com/explore/v2/metal?limit=50&consumer_key=XXX
check here, soundcloud removed order by hotness.
Has order by hotness been removed from Soundclouds API
so, for now, only order by date is possible.
I've been trying to figure out how to do this, and was thinking it wasn't possible, then found this website: (Removed due to a dead link)
You can search by city there and I have no idea how they do it? The normal graph API's don't allow searching for events by location as far as I can see. Any advice/tips/info would be great!
Updated 2014-07-02
You can't directly search the Facebook API for events near a location. Since originally giving this answer, the Graph API has made it harder to search for events.
The Elmcity script referenced by the OP does a simple search for a keyword in the event title. Try "Lancaster" for example. You'll get events that have the word Lancaster somewhere in their metadata.
Their query looks something like this:
https://graph.facebook.com/search?q=lancaster&type=event
You can also search for a non-location based word in the title like "picnic" and the script returns events.
For the problem of actually finding events near a location, in the current iteration the "venue" field is only a string, so it has no relationship to any Facebook place. Running these query returns nothing:
https://graph.facebook.com/madisonsquaregarden/events
https://graph.facebook.com/108424279189115/events
So using a batched request isn't even a possibility.
According to the documentation FQL seems to be a better solution. In the event documentation, the venue.name column is indexable! Easy, right?
Wrong. When you run this FQL query to find events at some location like this:
SELECT name, start_time, venue FROM event WHERE CONTAINS("madison square garden")
You find that venue.name isn't populated.
Trying any other variation like:
SELECT name, start_time, venue FROM event WHERE venue.id = 108424279189115
Throws a "statement not indexable" error.
So while building a "Facebook Events Near Me" is the killer app, the only way that it seems possible is to search for common strings for events near you, get those events, then filter out irrelevant events from the result set.
This JavaScript library on GitHub seems like an interesting approach to look at. It uses a places search and then does an events search on those places.
tobilg/facebook-events-by-location-core
As of recent. the Events end points have been deprecated due to the privacy issue.
Your app will now need to be reviewed first to access events api, when it resumes.
Events and points has been deprecated due to privacy issues. Now you have to review your app before you can access events api. After successful approval you can search events.
So what you can do is enter "Events", but you need to enter the date, or tomorrow after that. Then, on the right, in your filters, enter the location field, select other, then punch in the location you want.
I have an application that uses the Facebook Ads OLD REST API and recently I heard that it will be deprecated in a month, so I'm working hard to migrate all my code to the new Graph API...
Unfortunately, nothing goes smoothly.
when calling to GET /act_{account-id}/adcreatives to get the AdCreatives for a specific campaign the parameter creative_ids is not working and always retrieving all the creative for the account!
This was working fine in the rest api... and no documentation changes were made in ads.getCreatives so I'm assuming creative_ids paramter is still there...
Any help will be appreciated!
thanks,
Yaniv Hakim
I found the _ids parameters to be finicky so I use the generic ids=comma-separated list parameter, without the act_{account-id}. Creative IDS are unique across accounts so there's no need to specify the account-id. If you want to use the specific parameters, have you tried creative_id, creativeids, creativeid and other permutations you can think of (with and without account-id)?