In my application, I use the Odata Uri generated by breeze as a deep linked url.
Is there a way to get the reverse of this odata query, which is the breeze.EntityQuery that was originally used to build this uri?
Thanks
No, not for the OData URI format.
However, the new JSON uri format supported by breeze, is completely reversible. If you are willing to switch to that, you will be able to get the breeze.EntityQuery from the JSON that is serialized on the URI.
I'm not sure how that would mess up your deep linking.
Related
I am trying to use filter and orderby query parameters to sort or filter the results. But the API is ignoring the query parameters and returning entire results.
https://graph.microsoft.com/v1.0/sites/{site_id}/drives?orderBy=name%20desc
I'm not sure why this isn't documented in the Microsoft Graph documentation (it should be), but from the OneDrive API documentation itself:
Note that in OneDrive for Business and SharePoint Server 2016, the orderby query string only works with name and url.
I've added an issue to the documentation's repository so this issue can hopefully get resolved in the future.
Although the original OneDrive API docs/Graph Drive API docs state they support orderby, but the actual OneDrive Graph API should be have not support filtering or ordering results. So although we pass the orderby parameter, when Microsoft Graph sees a query parameter it doesn't expect, it simply ignoring the unknown filter/orderby parameter and returning us an unfiltered/default-sorted result.
My test string:
https://graph.microsoft.com/v1.0/sites/my-site-id/drives?$select=id, name,webUrl&$orderby=name%20desc
So the only suggestion for you is to vote up the existing feature request in User Voice or submit a new one.
I am unable to determine how to get $search parameter to work for full text search in odata.
The following url indicates that it should be included in 6.1
http://blogs.msdn.com/b/odatateam/archive/2014/03/21/odata-6-1-and-odata-client-6-1-are-now-shipped.aspx
I have created a sample application using the following template
http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/create-an-odata-v4-endpoint
When I execute the odata query
http://localhost:53621/odata/PartnerMaster?%24format=json&%24top=100&%24orderby=PartnerName&%24search=Test
I receive the error message.
message=The query parameter '$search' is not supported
:) See you again. Copy the answer here to let more people aware of it.
ODL supports to parse the $search query option, however, Web API OData doesn’t support it so far.
While, in ODL, you can refer the following test cases:
https://github.com/OData/odata.net/blob/master/test/EndToEndTests/Tests/Client/Build.Desktop/TripPinServiceTests/TripPinServiceTests.cs#L515-L576
https://github.com/OData/odata.net/tree/ae0dd29c1cf430255a8ec9c4225b4745e25cad64/test/FunctionalTests/Tests/DataOData/Tests/OData.Scenario.Tests/UriParser/Search
https://github.com/OData/odata.net/tree/ae0dd29c1cf430255a8ec9c4225b4745e25cad64/test/FunctionalTests/Tests/DataOData/Tests/OData.Scenario.Tests/UriParser/SearchCombination
Going through the documentation for the Sharepoint API (located here: http://msdn.microsoft.com/en-us/library/office/dn605900(v=office.15).aspx) I am trying to figure out how to select chunks of documents. I was expecting $skip to work, as it is implied that most OData functionality should be present, but this doesn't work. I also can't figure out whether or not $skiptoken is a valid query param. It's listed in the documentation near the bottom (without further explanation), but I can't coax the proper result out of it so far.
If somebody knows about $skip or $skiptoken or another method available for getting chunked responses back, help with this problem would be great!
EDIT: to clarify, things like API_URL/files?$orderby=url&$top=5 work, but things like API_URL/files?$orderby=url&$skip=50 do not. However, I have just found a 'next' URL in the response which appears to provide server-side paging support. I'll try to figure out the use of $skiptoken from here.
The OData V4 protocol has specified (referencing 11.2.5.7 Server-Driven Paging) that:
OData services may use the reserved system query option $skiptoken when building next links. Its content is opaque, service-specific, and must only follow the rules for URL query parts.
OData clients MUST NOT use the system query option $skiptoken when constructing requests.
Thus, the implementation of the O365 SharePoint API that it publishes $skiptoken as a query option that the client should use for excluding first few items in the queried collection is a violation of the protocol. The client should use $skip for such scenario. But it seems from the O365 spec you attached that $skip is not implemented.
If you query a entity set of the O365 service and the response payload contains a next link (a #odata.nextLink annotation in the response JSON object), then it indicates that the service has server-side paging for the entity set. Typically the next link would be a URL containing the $skiptoken query option such as http://host/service/entityset?$skiptoken=n that the client can use for getting the next page.
I'm using Restlet v2.1.2 to build a Java based REST service. Everything has been working flawlessly BUT no I've run into problems while trying to PUT/POST to the service using a .Net client, which in turn uses RestSharp to talk to the service. As I mentioned various GET/PU/POST/DELETE request have all worked flawlessly but now when I try to send a "large" request I've run into problems.
I have a URI looking something like: "http://:/matches"
What I'd like to do is to provide two URI parameters {index} and {base64encoded} but as the {base64encoded} may get veeeeeery large, I unfortunately have to rely on PUT/POST in order to use the request.AddBody() method and there provide an object containing those parameters. Furthermore I set request.RequestFormat = DataFormat.Json; but when I execute the request I get either a http 405 or 415 error.
What am I doing wrong here???
I'm so sorry! I had simply overseen the fact that I had forgot to provide the "...foo(JsonRepresentation bar)" parameter declaration for the Get method!!! After adding this parameter it works like a charm:) Thanks for your reply though...:)
I am building a rest api in mvc. When consuming the API, I need to be able to get the referring URL that is calling the service. I have tried Request.UrlReferer and it comes back null. How can I get the url that is consuming the service?
Are you sure you don't mean in the consumer you need to know the referer of the client making the REST call?
If this is the case what you need to do is look at the request header and extract from it the Referer.