Is the checkin object's type=mayorship notification appears fickle? - api

I have some questions about 4sq's API.
Chceckin object obtained by checkins/add endpoint's response sometimes has mayorship field and at other times not.
And mayorship's checkins count field seems not reliable (often appears count 0, but actual count is 2).
Is it so?
thanks.

The notification only contains mayor information if the user is somewhat close to being able to claim the mayorship.
As for incorrect checkin counts, you'll need to provide an example response for us to be able to debug.

Related

Can anyone help me with the marvel api characters per event response?

I'm using the marvel api the get all of the events they have.
I need to get all of the characters of all the events, but I only receive 20.
its says "available: 75" "returned: 20"
Can anyone help me with that?
Take a look at:
Source: https://developer.marvel.com/docs#!/public/getEventsCollection_get_18
You can either raise the limit of the events returned or execute multiple requests to get all the data. I advice you to do multiple requests as this is more future proof (when e.g. the amount of events is higher some other time).
You need to add &limit=100& between ts and the apikey. For example: ...characters?ts=1&limit=100&apikey=xxx

eBay API: get watch count for the particular item

I want to retrieve a number of watchers for the particular item using eBay API. I tried setting IncludeWatchCount to true in GetSingleItem request, but it appears that it works only for the seller of the item. Is it possible to get the number of watchers without being a seller?
I literally just joined in on SO with a new account because I lost my previous email with which I had the old one just to answer your question.
Anyway, If you call findItemsAdvanced, under listingInfo there is a watchCount field. It only works with findItemsAdvanced and not with any other.
[NOTE] The watchCount variable is not in the documentation. You should dump the response given by findItemsAdvanced, find listingInfo and it will be there

What is the proper way to format a GET request to retrieve all media items of the Instagram user "self"?

Looking at https://www.instagram.com/developer/endpoints/users/ I have gathered that calling https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN will return "the most recent media published by the owner of the access_token."
In sandbox mode I understand that I will receive a maximum of 20 media items from this call. I also realize that the response code has a pagination object that I can use to retrieve up to 20 more media items (see below)
"pagination": {
"next_max_tag_id": "1387272337517",
"deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead",
"next_max_id": "1387272337517",
"next_min_id": "1387272345517",
"min_tag_id": "1387272345517",
"next_url": "https://api.instagram.com/v1/tags/cats/media/recent?access_token=xxx&max_tag_id=1387272337517"
}
These are the listed parameters of this Request.
PARAMETERS
ACCESS_TOKEN A valid access token.
MAX_ID Return media earlier than this max_id.
MIN_ID Return media later than this min_id.
COUNT Count of media to return.
My question is: Is there a way to structure my GET request in a way that returns all media items from a single call? I understand that this is not possible in sandbox mode, given a user with more than 20 media items. If possible please provide a detailed explanation of the COUNT parameter.
I imagine a possible GET request would look like https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN?COUNT=X
Thank you. <3
When you go live mode you can use the count= param to get more than 20 in one API call, however I have noticed that count=33 is the maximum you can get for this API call, even if you anything more than 33, it only returns 33.
You still have to use the pagination in JSON response to get the next set of media items, easiest way is to use the pagination.next_url to make API call and get next set of media items

How to get maximum number of tweets on an user

i have this code
("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser.'&count=500'
But it is giving me only 200 records , I found in twitter document that it will give 3200 tweets.Is i am doing wrong what should i do to get that much tweet.
Since there is no page system in twitter 's API, to go throught timelines, you must use the "max_id" parameter.
Here is an helpful link that explains how to work with timelines with nice illustrations: https://dev.twitter.com/rest/public/timelines.
Edit: here is how you do it.
"To use max_id correctly, an application’s first request to a timeline endpoint should only specify a count."
Make your request "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser.'&count=500 (you can put 200).
Then when you get all your data, " keep track of the lowest ID received" and use it as parameter (the same way you do for the count) for your next request. it will give you the 200 next posts with a lower id than the one you specified. Do it again until you reach the end.

What are the Aweber API Variables $account_id and $list_id?

You can check here:
https://labs.aweber.com/docs/code_samples/subs/create
The script to add a new subscriber to the list via api requires those two pieces info...only I cannot figure out for the life of me what those two variables are!! I've beaten through every little aspect of my Aweber Subscriber Account, AND my Aweber Labs account...and I can't find any reference to either of those variables anywhere. I've submitted some tickets to them, and haven't gotten any response yet.
Does anyone have any ideas here? I've tried my account names, my list names, to no avail!
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Okay, I've got it! You can get the values of both of these variables by dumping some other variables in the aweber api after making certain api calls.
get the account id first:
$account = $aweber->getAccount($accessKey, $accessSecret);
then vardump or print_r $account.
next we get the list id:
$account = $aweber->getAccount($accessKey, $accessSecret);
$list_url = 'https://api.aweber.com/1.0/accounts/<id>/lists';
$lists = $account->loadFromUrl($list_url);
then vardump or print_r $lists.
And you are all set! I'm so happy I figured this out, it freakin took long enough. Hopefully this saves some one a bit of time.
I too have agonized over finding the $list_ID, so went to deactivate the list, and create a new one, and "discovered" that if you hover over the Deactivate button, you get a url you can copy, and this gives both %account and %list Ids
https://www.aweber.com/users/lists/deactivate/$accountID/$lisID
like this....
https://www.aweber.com/users/lists/deactivate/123456/123456
Hopefully this will help make someone as it is a super easy solution
The proper answer is Anne Allen's one, but...
Check the return of the /accounts endpoint. It should return the same account id as you detected in the link, but I had cases they were different (strange, isn't it?). Use the account id returned by the /accounts endpoint and other endpoints to retrieve lists, subscribers, etc. will start to work. It's like if some accounts have two ids, one partially works and the other fully works.
Let me tell you how to get $list_id value... login into your AWeber account and then create a new list copy only integer value from list's name.
At first, login.
1) click Reports>Settings. Your account ID will be displayed in the box,example: ?id=XXXXX
2) click List Options>List Settings. There you will see the list ID under the name.
p.s. To add subscriber, you can use this - Automatically add into aweber list