Office 365: How to find maximum length of item id - microsoft-graph-api

I am trying to figure out the maximum length of the ID of the Office 365 item. E.g. there is DirectoryObject resource type https://learn.microsoft.com/en-us/graph/api/resources/directoryobject?view=graph-rest-1.0. It has an ID field but the maximum length of this field is not mentioned anywhere.
Similarly, for Exchange online we have mailbox IDs. Is there any document that mentions the maximum length of these Office 365 items (DirectoryObject, Drive, DriveItem, Teams/Channel ID, Mailbox, etc.) Or if there any programmatic way of figuring out the maximum length? Please let me know.

There is no specified maximum length. You can't assume anything.

Related

Is there any restriction for number of characters in TFS REST API?

I am trying to retrieve workitems from TFS using REST API. https://servername/tfs/collectionname/_apis/wit/workitems?ids='xxxx,yyyy,zzzz,....n' (where n count is 420). Each id is a 4 digit number. I could not retrieve more than 409 workitems. If the query exceed more than 409 ids, I receive "404 - File or directory not found" error. Please help me to find solution for this.
I can reproduce this issue,it has restriction for the length of the strings when using the REST API.
In this case, we can not get all the work items in one time, we can get the work items separately, just call the API twice.

What is the right default for the maximum length of a string in rails 4 on postgres?

I have a rails (~4.2.3) blogging platform app on postgres (~9.4.0.1), where the title of a post is a string. I want to allow the blog administrator to specify the minimum and maximum length of the title for their blog, so I have title_min_length and title_max_length properties. I want to provide flexible defaults for these two values. min_length could, of course be 1. For the max_length, I would like to allow whatever is the minimum guaranteed maximum length for a string field in this stack (rails + postgres). What should that value be, given the real limit is the available memory?
According to this answer on SO, there is no limit in Postgres. Also, according to this other answer, as of rails ~4, the ActiveRecord string size limit of 255 has been removed, and a string can be arbitrarily long.
Given that, what is a reasonable maximum length limit to specify as a default? I do not want to artificially restrict the user by picking too short a length.
You can retrieve informations on your table with MODEL.columns and MODEL.columns_hash.
This will get you how many chars you can store in your column.
col_size = Post.columns_hash['title'].limit
But from the first answer you linked size depends on how this column is defined, :string or :text, so column size either 255 or 65536. if you don't set limit yourself in migration.

Why limited number of next page tokens?

Through a script I can collect a sequence of videos that search list returns. The maxresults variable was set to 50. The total number items are big in number but the number of next page tokens are not enough to retrieve all the desired results. Is there any way to take all the returned items or it is YouTube restricted?
Thank you.
No, retrieving the results of a search is limited in size.
The total results that you are allowed to retrieve seems to have been reduced to 500 (in the past it was limited to 1000). The api does not allow you to retrieve more from a query. To try to get more, try using a number of queries with different parameters, like: publishedAfter, publishedBefore, order, type, videoCategoryId, or vary the query tags and keep track of getting different video id's returned.
See for a reference:
https://code.google.com/p/gdata-issues/issues/detail?id=4282
BTW. "totalResults" is an estimation and its value can change on the next page call.
See: YouTube API v3 totalResults field is returning 1 000 000 when it shoudn't

QuickBooks TxnID Format

I'm looking to allow a user to enter either the RefNumber or TxnID into a textbox to query for an Invoice. What is the format for a TxnID? I'm considering using a RegEx pattern to determine whether it's a TxnID or not. Thanks!
From the QB OSR...
TxnID is of type IDTYPE
An IDTYPE (identifier type) is a string with a theoretical maximum length of 36 digits, though the allowed maximum depends on the situation. An IDTYPE returned from QuickBooks is a concatenation of the object ID and creation time, separated by a hyphen.

Twitter search API results

I'm using the Twitter API atom format
http://search.twitter.com/search.atom?q=Name&:)&since:year-month-date&rpp=1500
but it's only returning 100 tweets, I tried using the JSON format as well, but it only returned 100 results. Is there anything that I'm doing wrong to only get 100 results?
Yes, you're limited on the number of results per page. In order to get more results, you have to use the page parameter like so:
http://search.twitter.com/search.atom?q=Name&:)&since:year-month-date&rpp=1500&page=2
EDIT
rpp: the number of tweets to return
per page, up to a max of 100. E.g.,
http://search.twitter.com/search.atom?lang=en&q=devo&rpp=15
page: the page number to return, up to
a max of roughly 1500 results (based
on rpp * page)
Source: http://search.twitter.com/api/
In other words your rpp won't work as you expect because the max is 100.
My sugestion.
Make a request to your API and retrieve 100 results by time.
Use a loop to check if your result count is set to 100.
if true, do a new request to page 2.
test again and check the number of itens until the resultset is lower than 100.
The Twitter Search API has changed, including in the naming of the parameters: for instance, rpp is now count and the page parameter was removed in favor of max_id, a parameter based on a timeline concept:
"To use max_id correctly, an application’s first request to a
timeline endpoint should only specify a count. When processing this
and subsequent responses, keep track of the lowest ID received. This
ID should be passed as the value of the max_id parameter for the next
request, which will only return Tweets with IDs lower than or equal to
the value of the max_id parameter."
https://developer.twitter.com/en/docs/tweets/timelines/guides/working-with-timelines
The updated link to the Twitter search api is:
https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html
Remember that not all tweets are indexed and if you are using the non-commercial version, you are limited to a 7-day search.

Resources