Twitter API followers/ids - All Followers Returned but next_cursor is still present - api

I have been working with the Twitter API [followers/ids] for a few of our accounts but recent got stuck with a confusing state.
Usually twitter returns a next_cursor when there are still some records remaining in next page(s). It works fine with iteration but recently when I tried to request followers/ids for one of our accounts which doesn't have a lot of followers (just over 4200) and all can be returned in single request. Even though, the API returns all the followers in a single request but strangely the next_cursor is still present.
So when I try to make another (2nd) request with that cursor, only one record is returned which is not present in the first set of records.
What should I consider that how much followers the user actually have?
Total Followers: 4224
1st Request: 4224 [next_cursor: present]
2nd Request with cursor: 1
This is creating confusion as it is 4224 or 4225?
Attaching a screenshot

Related

Amity API I have some problem with this API /api/v3/users/list

I wanted to get multiple user information with one request, so I used /api/v3/users/list. [According to https://api-docs.amity.co/#/]
It worked fine the first time. However, if there is a wrong user id in the request, the API will return 400. In other words, if I want to search these user IDs 1234 and 4567 but 4567 does not exist, API will return 400. Is it possible to return the existing ones and ignore the non-existing ones?

Unable to POST NZ employee openingBalances to Xero?

I am attempting to create a single opening balances record against an existing employee but keep getting a 400 Bad Request response with this detail...
At least one NZ opening balance item is required in the request
I am following the instructions as per this documentation...
https://developer.xero.com/documentation/api/payrollnz/employeeopeningbalances#post-opening-balances
URL : {DestinationID} is properly replaced with the employee GUIDhttps://api.xero.com/payroll.xro/2.0/employees/{DestinationID}/openingBalances
JSON Body[{"periodEndDate":"2011-01-30T00:00:00","daysPaid":5.00,"unpaidWeeks":0.00,"grossEarnings":1442.31}]
The Xero forums and support is pretty unreliable so I'm posting here in the hopes for a better response.
After some trial and error using the API Explorer that Xero provides I was able to get it working using their example....
I eventually learned that daysPaid and unpaidWeeks must both be integer whole numbers or else it fails.... The error message provided is misleading but this resolves the problem.

Shopify collect orders with rest API error

I am trying to get the Shopify orders list with the latest version of rest pagination API. There are totally of 1000 orders. I set a limit of 200. First page of API hit is working properly. While I am hitting the second page with page info I am getting error as below. Can you help me please regarding this.
Rest API URL: GET https://the-commerce-shop-1.myshopify.com/admin/api/2020-01/orders.json?limit=200&page_info=eyJzdGF0dXMiOiJhbnkiLCJsYXN0X2lkIjoxODY4Njk3NjY1NTkxLCJsYXN0X3ZhbHVlIjoiMjAxOS0xMS0yNSAwOTozNjo1OSIsImRpcmVjdGlvbiI6Im5leHQifQ&status=any
Error: Message: Client error: GET https://the-commerce-shop-1.myshopify.com/admin/api/2020-01/orders.json?limit=200&page_info=eyJzdGF0dXMiOiJhbnkiLCJsYXN0X2lkIjoxODY4Njk3NjY1NTkxLCJsYXN0X3ZhbHVlIjoiMjAxOS0xMS0yNSAwOTozNjo1OSIsImRpcmVjdGlvbiI6Im5leHQifQ&status=any resulted in a 400 Bad Request response:\n{\"errors\":{\"status\":\"status cannot be passed when page_info is present. See https:\/\/help.shopify.com\/api\/guides\/pag (truncated...)\n, Line: 113"
First you ask for orders with nothing but the status you want and a limit. That initates the paging.
Once you are through your first 200 orders, you no longer call the endpoint with status or limit, you simply use paging.
That works.

Office 365 REST API /$count filter giving wrong data

I'm trying to get count of records for different objects. The response of /$count filtered APIs is inconsistently giving wrong response.
I am referring this documentation link for usage instructions.
Request URL: GET https://outlook.office.com/api/v2.0/me/Events/$count
Response: -1
To verify if the above mentioned response is legitimate, I tried to get all events with a skip filter to identify the actual number of records present.
After a certain attempts following request URL gave me final count:
Request URL: GET https://outlook.office.com/api/v2.0/me/events/?$skip=159
Response:
{
"#odata.context": "https://outlook.office.com/api/v2.0/$metadata#Me/Events",
"value": [
{
"Id": "AAMkADMzYzIxNTBjLWUyMWUtNDgzYi04NTEwLTc5YTkzMWI5MmE4MgBGAAAAAABjOnbtK9ZkTIjwInd5bfYcBwDe_ScfFfAUQaKHRwnzV1lBAAAAAAENAADe_ScfFfAUQaKHRwnzV1lBAACs2ojfAAA=",
"CreatedDateTime": "2016-11-28T11:09:03.8359488Z",
"LastModifiedDateTime": "2017-02-21T08:04:48.8262751Z"
}
]
}
This implies that after skipping 159 records, I've 160th record present in the authenticated account but $count filtered API doesn't give me a valid response.
I tried testing this scenario with two different accounts where I noticed this anomaly for /message API as well. The HTTP GET call to messages/$count gives me 1563 whereas after trying with skip filter I found the total count to be 1396
I want to know if $count returns a legitimate response? If yes then explain this anomaly If no then is there any pattern where we should expect response to inconsistent?
To get a count of the number of events, you need to specify start time and end time. Here is what I use:
https://outlook.office.com/api/v2.0/me/calendarview/$count?startDateTime=2017-05-01T00:00:00Z&endDateTime=2017-05-31T23:59:59Z
If you don't specify the dates, you will get 400 with the following error message:
{"error":{"code":"ErrorInvalidParameter","message":"This request requires a time window specified by the query string parameters StartDateTime and EndDateTime."}}

itemSummary.getItemData() returns null occasionally

I'm using the java API version 10.2. Here's how I obtain the ItemSummary:
DataExtent dataExtent = new DataExtent();
dataExtent.setStartLevel(0);
dataExtent.setEndLevel(Integer.MAX_VALUE);
ItemSummary itemSummary =
Util.getDataService().getItemSummaryForItem1(myContext,
new Long(myItemId), dataExtent);
itemSummary is returned with a 0 status and the correct containerType of BANK. But itemSummary.getItemData() is sometimes null. I say sometimes because if I use the same itemId after a period of time, getItemData() is no longer null (which it should't be). There seem to be an issue if I perform a removeService, addService and getItemData() in quick succession. Any thoughts?
When you do addService yodlee has to go to the bank's website and grab the data. Hence until yodlee has the data you will not have anything in ItemData.
You can call the isItemRefreshing API which will tell you if the item added has finished refreshing and once it does, then if you get the itemSummay and if the item was successfully refreshed then itemData should not be null