It looks like the termsLimit parameter for autosuggest is not working - unless we are doing something wrong? The following request specifies a maximum of 3 query term results but returns 5:
https://autosuggest.search.hereapi.com/v1/autosuggest?in=bbox%3a-98.96484375000001,25.633671669021734,120.58593750000001,72.39307050880166&limit=20&termsLimit=3&q=oxfor&apikey=
Related
I'm trying to use delta query to get teams channel messages updates according this documentation: HERE
This is the request url:
https://graph.microsoft.com/beta/teams/<teamId>/channels/<channelId>/messages/delta
However, calling the returned nextLinks one after another never returns a deltaLink. There're too many pages of results and it causes my app to be throttled before ever getting a deltaLink from it.
In other delta query endpoints, $top is supported to limit the number of results returned. Usually I'm able to get a deltaLink after calling the nextLinks once or twice. But $top doesn't seem to have an effect in the channel messages endpoint.
So I tried appending another queryString ?odata.maxpagesize=10 to the request instead, and it seemed to work a week ago. I was able to get the deltaLink after 2 pages. But it looks like Microsoft might have changed the API and this workaround no longer works.
I also tried adding Prefer: odata.maxpagesize=10 in my request header according to this documentation: HERE
But the nextLink this generates is too long and it gives me this error instead:
HTTP Error 414. The request URL is too long.
Has anyone been able to use this delta for channel messages? Or have I done something wrong?
The clockify API is unclear (to me) about how to iterate through results.
For example, https://clockify.github.io/clockify_api_docs/#operation--workspaces--workspaceId--timeEntries--get says
Each request is limited to 10 time entries. To get the other 10 (and the next 10 and so on), you'll have to include the page parameter and increment it with each request (eg. https://api.clockify.me/api/workspaces/{workspaceId}/timeEntries/?page=1)
Data returned from this endpoint is merely an array of timeEntries (bonus for being simple!). Reading beyond the last page returns an empty array (status=200).
So, the question is: Does clockify intend that clients read until an empty array, or am I missing something?
This is the existing behaviour I am afraid.
Hopefully, there will be "CurrentPage", "PageLength", "TotalPages" or at least "TotalRecords" in the RESPONSE body someday.
EDIT:
According to the support response their developers are working on adding TotalRecords node to let us know how many items we can expect.
I am using the wikipedia API to query for a search word, for example by making a GET request to this URL:
https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&utf8=1&srprop=snippet&continue=&srsearch=Slovenia
This query returns a total of 51429 hits, but will only display the first 10 results. From reading the documentation on this topic, I gather that to get the next 10 results I should pass in the continue parameter.
The relevant parameters in the API response are here:
continue: {
sroffset: 10,
continue: "-||"
}
So I build my url in the following way:
https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&utf8=1&srprop=snippet&continue=-||&srsearch=Slovenia
But the URL returns the same set of results.
What am I doing wrong?
You should pass on the contents of the continue field. I.e. sroffset=
10&contiue=-||.
Is there a way to replace a GET parameter value from twig?
For example, I have a page at this address:
http://localhost/app_dev.php/test/?param1=40&sort=name
And in my twig I want to build 3 links like this:
http://localhost/app_dev.php/test/?param1=40&sort=name
http://localhost/app_dev.php/test/?param1=40&sort=address
http://localhost/app_dev.php/test/?param1=40&sort=code
For now I added the "&sort" parameter once again at the end on the URL, but this solution is actually a "patch" and it sucks!
address
In this example I only have 2 parameters, but in reality I have around 6 parameters, because the link that's generated it's obtained by submitting a .
This should solve your problem:
{{ path(app.request.attributes.get('_route'),
app.request.query.all|merge({'sort': 'address'})) }}
It gets the current route and all query parameters which are merged with the one you like to update before they are appended.
Symfony/Twig path function accept optional params. If these params are part of the route, they're handled by router but if they're not, they are passed as GET parameters.
So, if your corresponding route is, for example, my_route :
address
I have a problem when passing parameters in querystring. I found that its values are null.
Below my code snippet:
page1 - here I am passing some parameters:
Response.Redirect(string.Format("RequestReservationPage.aspx?plcName={0}&PLCIndex={1}&Email={2}&form={3}&to={4}&SR={5}&Comment={6}", lblPLCNameVal.Text, index, lblEmailVal.Text, DateTime.Parse(lblReqFromVal.Text).ToShortDateString(),DateTime.Parse(lblReqToVal.Text).ToShortDateString(), lblServReqNum.Text, lblYourCommentVal.Text));
page2 - here I am requesting its values:
cmbPLCRequest.SelectedIndex = Convert.ToInt32(Request.QueryString["PLCIndex"]);
txtEmail.Text = Convert.ToString(Request.QueryString["Email"]);
txtSR.Text = Convert.ToString(Request.QueryString["SR"]);
txtComment.Text = Convert.ToString(Request.QueryString["Comment"]);
txtReqFromDate.Text =Request.QueryString["from"];
txtReqToDate.Text = Request.QueryString["to"];
but I found that both of Request.QueryString["from"] and Request.QueryString["to"] return null
any idea?
see this
The amount of data you can transfer on
the QueryString is limited by a number
of factors, but the one that seems to
be the most restrictive is the space
in your browser's address bar. The
Internet Explorer versions 5 and 6
that I tested only allowed up to 2,047
characters while Netscape Navigator
version 4 seemed to be able to handle
up to 30,000 and I couldn't get
version 6 much past 9,000.
See this MSDN article for other options instead of passing variables by using the querystring
EDIT: try storing your values in the POST parameters if you need large strings
Two problems: typo in the from - in the Redirect code you got it as form.
Also, you better encode all the values to be fit for URL.. so the code will be:
Response.Redirect(string.Format("RequestReservationPage.aspx?plcName={0}&PLCIndex={1}&Email={2}&from={3}&to={4}&SR={5}&Comment={6}",
Server.UrlEncode(lblPLCNameVal.Text),
index,
Server.UrlEncode(lblEmailVal.Text),
Server.UrlEncode(DateTime.Parse(lblReqFromVal.Text).ToShortDateString()),
Server.UrlEncode(DateTime.Parse(lblReqToVal.Text).ToShortDateString()),
Server.UrlEncode(lblServReqNum.Text), Server.UrlEncode(lblYourCommentVal.Text)));