Get all messages from Outlook API - outlook-restapi

I'm consuming the Outlook API, attempting to access all messages from an inbox which contains ~45,000 messages (and other folders such as Sent Items).
The main request I'm making is to https://outlook.office.com/api/v2.0/me/messages. If I add ?$count=true, the "#odata.count" value is returned as -1.
I can add $top=500 to the request which gives me 500 messages returned and an "#odata.nextLink", but if I pass $top=5000, there's no "#odata.nextLink" which I'd expect to see.
A few particular questions here if anyone can help:
Is this the best way to try and get all the messages out of all folders?
Is there a reason count would be returning -1, and is there a way to get an accurate figure of the number of messages returned?
Is there a maximum $top size I need to pass to get a valid request back?

Yes, but understand it includes Drafts, Deleted Items, and Sent Items in addition to all of the other mail folders.
This is a known issue with /me/messages. Basically the way that /me/messages gives all messages across all folders is by using a search folder, which dynamically updates. The API doesn't report accurate counts for search folders (usually just returns -1).
The highest $top should be 1000.

Related

How to solve updating a list of contacts depending on user input, 429 error (too many requests)

We have a react frontend, that has a name field, a user will write in the field and a list with search results of their contacts shows up, each time the user writes a character the search is updated. Right now it sends a request with a search query to the server each time a new letter is added in the field and this creates a whole bun ch of requests.
How would you solve this? send the whole list and the let the client to the search? I would prefer not to. Maybe limit the requests in some way? I assume this must be something that every search engine has to handle some way?

How can I paginate Pagerduty REST API results when requesting incident lists?

I'm building an application which pulls down incident listings for my org via Pagerduty's REST API.
The GET /incidents endpoint does respond with more, offset, and other keys that are indicative of pagination being supported, and it does make intuitive sense on this endpoint, but I haven't been able to actually paginate these results:
Passing offset or limit as a query param returns a 403
Passing these in various forms in request headers just gets ignored entirely
Is there a way to paginate these results at all?
it might help to include the code you're using to make the request, or a curl request from the command line. Including pagination parameters shouldn't lead to a 403, so I'm thinking something else might be missing.
You should be able to paginate the lists using GET parameters, e.g
https://api.pagerduty.com/incidents?limit=20&offset=100
limit has a maximum value of 100, and limit + offset together must be less than 10,000. That might be why you were getting an error?
See here for additional details on the pagination parameters
Yes, it's possible to paginate the results.
After invoking the API method for the first time, you need to check the more response field value. If true, then you can call the API method again with an updated offset.
offset is related to the total results, and not the total pages.
The 403 error code response you're getting is most likely related to the user permissions and not with paginating results.

Number of text response in Dialogflow

I am new to Dialog flow and trying to build product search. So for that i have many text responses. While doing this my number of text response reached to 30.
As you can see in screenshot it reached till 30 and i didn't find any option to write another text response. So clicked on Add Message Content and added new text response. But now when i query something it gives me multiple response.
So my question is:
1) Is there any way to increase number of text response(30) size. Or it is limitation.
2) If there in no way to resolve above issue. How can i get only single response as it is giving me two response from both text response
Text responses are available in all platforms.
Limitation-1: Your agent can send up to 10 sequential text messages in response to a user input (assuming no other message types are defined in the intent).
Limitation-2: You can add 30 variations to each text message response.
So, the answer to your question, there's no way, you can exceed this limit either in Standard or Enterprise edition. Secondly, what you're doing is adding a number of text messages when you reached a limit (30) while adding variations. You can resolve this issue either by deleting number of text messages or by creating different intents for different responses.
When you add variations, api.ai will randomly choose any one of those 30 responses written by you & show it to a user. You have multiple such text messages & so api.ai randomly chooses one response from each text message & so you're getting multiple responses. Hope this helps.
You shouldn't try everything in one single intent. Break into multiple to avoid complex scenarios.

Retrieving Recipient Status via REST API

There appears to be two ways I can gather status information about individual recipients on an envelope:
GET - v2/accounts/:accountId/envelopes/:envelopeId/recipients
GET - v2/accounts/:accountId/envelopes/:envelopeId/audit_events
Unfortunately, each of these suffers from a separate limitation that is making it difficult for me to use either.
This API call returns two DateTime values of interest: deliveredDateTime and signedDateTime. I am able to call and use this API successfully. However, it appears to me that deliveredDateTime is not specified until the user actually clicks the email link AND clicks the review documents button on the signer view. Since what I was actually interested in might be better described as sentDateTime, deliveredDateTime doesn't appear to work for my needs.
This API call returns a detailed list of all events that have transpired on the envelope, including individual receipient status updates. However, the data format is such that in order to tie the result data back to recipients, I have to do string matches on the recipient name. I'd prefer to do the match based on email or, better still, recipientID, but the audit log entries for "sent invitations" and "signed" don't contain these fields. Here is an example (click here to view larger):
Is there an API call other than these two that I can use? Is there a way to get additional data in the audit event API call?
Thank you in advance,
Andrew
I don't believe there's a way to get additional data from the audit_events call since the DocuSign API documentation (which is up to date) indicates that call has no parameters (other than the envelopeId in the URL).
I think you're stuck with doing a string comparison on the userName value to identify/link your recipients, however I want to point out that once you do that you can then link to their unique recipientGuid through the first api call you've highlighted here.
For instance, the /audit_events API call seems to achieve what you want and has all the info you need, however it identifies the recipients through their userNames. If you then make a call on the same envelope and check the response from the /recipients URI, it contains the name, email, recipientId, and recipientGuid for each and every recipient in the envelope. Match the user names and you now have access to their IDs, etc.
So in the end I don't believe there's one API call to achieve this but you can solve by doing one string compare and combining the results from the API calls you've highlighted.

Foursquare herenow always return 30 items. Is there any way to get more items?

I'm trying to get all users at same place as me (venues with a lot of people), but the endpoint https://api.foursquare.com/v2/venues/VENUE_ID/herenow returns more than 30 users in count property and only 30 people in items list.
Is there any way to get all check-ins and users at same place as me?
you can use the parameter limit to retrieve up to 500 users per request. use the parameter offset to page through more results. see here for more information.

Resources