Syntax error at position 57 in 'TimeZoneStandard='microsoft.graph.timeZoneStandard'Iana''' - microsoft-graph-api

I'm trying to request the supported timezones in the IANA format for a user (in Java), and getting the following error:
Error code: RequestBroker--ParseUri
Error message: Syntax error at position 57 in 'TimeZoneStandard='microsoft.graph.timeZoneStandard'Iana'''.
GET https://graph.microsoft.com/v1.0/users/email#redacted.com/outlook/microsoft.graph.supportedTimeZones(TimeZoneStandard=microsoft.graph.timeZoneStandard'Iana')
SdkVersion : graph-java/v2.3.1
Authorization : [PII_REDACTED]
400 : Bad Request
[...]
Based on our test suit, the request was working fine 3 days ago, and started failing with that error yesterday. We haven't changed anything for a while on our implementation, so I'm a bit baffled. For the request I'm essentially doing the following:
final String url = requestBuilder.outlook()
.getRequestUrlWithAdditionalSegment("microsoft.graph.supportedTimeZones(TimeZoneStandard=microsoft.graph.timeZoneStandard'Iana')");
final OutlookUserSupportedTimeZonesCollectionRequestBuilder builder = new OutlookUserSupportedTimeZonesCollectionRequestBuilder(
url, requestBuilder.getClient(), null
);
IOutlookUserSupportedTimeZonesCollectionPage page = builder.buildRequest().get();
The reason I'm doing this instead of the standard:
final IOutlookUserSupportedTimeZonesCollectionPage page = requestBuilder.outlook()
.supportedTimeZones(TimeZoneStandard.IANA)
.buildRequest()
.get();
Is because this isn't working as expected, as described here: https://github.com/microsoftgraph/microsoft-graph-docs/issues/7594 (the issue is for C#, but happens in Java too).
What I notice is that the GET url looks fine, and works fine in the Graph Explorer using the /me endpoint instead of the /users endpoint. But the string in the error message looks modified:
'TimeZoneStandard='microsoft.graph.timeZoneStandard'Iana'''
If I'm not mistaken, the outer apostrophes are simply quoting done when printing the error message, but there are further apostrophes introduced after the = sign, which aren't present in the GET URI, which might be causing the syntax error. Still, I have no idea where those come from.
Any help or hint would be greatly appreciated!

I have modified the call something like this
https://graph.microsoft.com/v1.0/users/UPN/outlook/supportedTimeZones(TimeZoneStandard='Iana')
It worked for me.

Related

ERROR STATUS: URL contains outer http

I have a COLDFUSION page which except parameters from url and show them in fields. My url looks like this which is working.
http://www.example.com/test.cfm?activeUrl=www.msn.com&secure=False
But following is not working. I have added http before www in activeUrl value.
http://www.example.com/test.cfm?activeUrl=httpwww.msn.com&secure=False
It is giving me following error. "ERRROR STATUS: URL contains outer http"
Can any one help me to solve this problem?
For me, It seems that something related to iis configuration.
The string in httpwww.msn.com is causing your browser error. It should be http://www.msn.com, but should also be URL encoded.
ohh, i have not checked the application.cfc ONREQUESTSTART method. it has some condition for query string, which is showing this error. :(

Whois Parser error for ORG/NET URLs

I have checking the whois information for .org/.net/.ae sites. While parsing it was giving error.
This is my code part:
record = Whois.whois(url)
date = record.created_on
Its giving the following error
Whois::ParserError: Unexpected token: Access to .ORG
What is the issue here. Its working for .com URLs.
The issue has been fixed in this pull-request and I've released a new version today. Make sure to use the v3.4.4.

ServiceStack request giving 500 for large request

I am using ServiceStack with MVC4 and getting 500 error when request parameters are long. I am posting ProductIds seperated by commas to controller via AJAX. In controller I have following call to servicestack API to retrieve data.
ResponseDTO res = restClient.Get(new RequestDTO { ProductIDs = ids});
//ResponseDTO res = restClient.Get(new RequestDTO { ProductIDs = "1234,1235,1236"});
If i submit small parameters in above, it works fine with no error. But when parameter string is in range of 1800 characters, it simply fails on above line and gives 500 Internal Server Error:
NetworkError: 500 Internal Server Error - http://localhost/Products/GetProducts
Exception Details: ServiceStack.ServiceClient.Web.WebServiceException: Not Found
is there a limit on GET method for posting large parameter request? Why does it fail for large request when for small parameters it successfully calls API, retrieves data via SQL procedure and sends to view correctly. What can I look into to solve this? Thank you!
p.s. when i debug via VS2012, i see exception details I see Message:Not Found and StatusCode: 404.
As Scott mentioned above, we tried POST for all methods and it fixed issue. I knew GET had limit on browser URL length but didnt think it matters as we had ServiceStack framework and all of their examples were using GET. Thanks again Scott.

405 Method not allowed on Net::HTTP request [ruby on rails]

I'm trying to verify if there is a remote url with following code:
endpoint_uri = URI.parse(#endpoint.url)
endpoint_http = Net::HTTP.new(endpoint_uri.host, endpoint_uri.port)
endpoint_request = Net::HTTP::Head.new(endpoint_uri.request_uri)
endpoint_response = endpoint_http.request(endpoint_request)
I'm still getting 405 Method not allowed. When I use Get instead Head in Net::HTTP::Head.new I'm getting 200 Success but also with whole remote document in response what results in bigger response time (0.3s => 0.9s).
Any ideas why this is happening? Thx
There's a chance that the #endpoint url you're trying to interact with doesn't support HEAD requests (which would be really weird, but still may be the case). Your code works fine for me with a handful of urls (google.com, stackoverflow.com, etc.)
Have you tried a curl request to see what it returns?
curl -I http://www.the_website_you_want_to_test.com

Adobe Flex 3 : Fault Event doesnt return XML Feed sent from Server

I am working on a flex application which communicates with a Rails backened.
When i request for some data, It sends back xml feed.
In some cases, if given parameters are not valid, then rails return an error feed with status code = 422 as following
email is wrong
But I dont get this feed in FaultEvent of Flex, How could i read error feed?
Thanks
Are you getting the result in ResultEvent in such cases? I am not sure for what all HTTP error codes FaultEvent will get invoke(I know only it goes for 404 and 500). May be its still going to ResultEvent as a valid result!
You can use HTTPService instead of URLLoader.
Flex HTTP results will not include the actual underlying HTTP response codes. It just doesn't work. (TM)

Resources