twilio + Azure File Stogare = The resource doesn't support specified Http Verb - azure-files

I am a new with twilio.
I am trying to make a call using CallResource.Create(to, from, url: _url);
regarding the URL : I have the Azure account. I have uploaded custom xml.
Below you can find my xml
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="alice">Thanks for trying our documentation.Enjoy!</Say>
<Play>http://demo.twilio.com/docs/classic.mp3</Play>
</Response>
For testing i am using test message.
http://demo.twilio.com/docs/classic.mp3 , in the future i am planning to upload custom mp3 file also to azure file storage.
The end URL is
https://xxxx.file.core.windows.net/xxxxx/20180719112627.xml?sv=2017-11-09&ss=bfqt&srt=sco&sp=rwdlacup&se=2018-07-31T18:27:28Z&st=2018-07-01T10:27:28Z&spr=https,http&sig=gNqLuAofhePeOzuyVFWHSb0TCydgIW3ShOrRRfFEZ7o%3D
Unfortunately, i have got the exception:
"An attempt to retrieve content from https://xxxxxxx.file.core.windows.net/xxxxxxx/20180719112627.xml?sv=2016-05-31&sig=Pa4ery3QIruwYbNSJ1Nu7Y3EpKLjbd5mJXi46vnpoyU%3D&spr=https%2Chttp&se=2019-07-19T09%3A26%3A53Z&srt=sco&ss=bfqt&sp=raupwl returned the HTTP status code 405"
<?xml version="1.0" encoding="utf-8"?>
<Error>
<Code>UnsupportedHttpVerb</Code>
<Message>The resource doesn't support specified Http Verb.
RequestId:907409a8-d01a-0051-1c43-1f4bf1000000
Time:2018-07-19T09:30:41.8204847Z</Message>
</Error>
Rerarding CORS for FILE SERVICE :
it is
Is there a document/guide describing the requirements how to configure the azure environment for integration with twilio?
Many thanks for help.

Have you tried using the SAS url by generating one using Storage Explorer or Azure Portal?

Related

Microsoft EWS api SyncFolderItems (mail) response ErrorInvalidSyncStateData but SyncState is correct

I used Microsoft EWS api SyncFolderItems to get mail changes, but got ErrorInvalidSyncStateData after several successful api calls.
The given SyncState request parameter is correct because it is the reponse from the last successful call.
The error response looks the same to the document shows
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="0"
MajorBuildNumber="628" MinorBuildNumber="0"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<SyncFolderItemsResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:SyncFolderItemsResponseMessage ResponseClass="Error">
<m:MessageText>Synchronization state data is corrupt or otherwise invalid.</m:MessageText>
<m:ResponseCode>ErrorInvalidSyncStateData</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:SyncState />
<m:IncludesLastItemInRange>true</m:IncludesLastItemInRange>
</m:SyncFolderItemsResponseMessage>
</m:ResponseMessages>
</SyncFolderItemsResponse>
</soap:Body>
</soap:Envelope>
I use the above api to synchronize mails to my local storage. If I got ErrorInvalidSyncStateData, all I can do is delete all mails in my storage, and then re-synchronize mails (starting from empty SyncState).
I'm wondering if there is a better way to handle the error if someone has the experience using SyncFolderItems api.
Thank you.
There are few methods to avoid the above error. If you follow them you won't get the error.
Ensuring that the sync state value you are sending matches the sync state value returned during a previous synchronization.
Ensuring that you are not sending the sync state for the folder hierarchy when you attempt to sync items, and vice versa.
Ensuring that you are sending the sync state for the correct root folder.
Ensuring that the same root folder is specified in each request.
Ensuring that the previous request did not specify a root folder of
null, while the current request includes a root folder of root. Null
and root are not treated the same.
[Microsoft Documentation]: https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/handling-synchronization-related-errors-in-ews-in-exchange

aws presigned upload URL return json?

Is there a way to make a presigned aws upload URL return a json response if there is a error rather then a xml response.
Currently it returns something like the following if the url is expired.
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>AccessDenied</Code>
<Message>Request has expired</Message>
<X-Amz-Expires>900</X-Amz-Expires>
<Expires>2020-02-06T20:13:39Z</Expires>
<ServerTime>2020-02-06T20:26:33Z</ServerTime>
<RequestId>2A23445454569</RequestId>
<HostId>oi3j4o5ij346?3464556756567/5675685745yfghr5y4/456345345=</HostId>
</Error>
Would be nice if this was a json response instead.
No, there is no way. It is not specific to pre-signed-url endpoints but S3 doesn't return json but xml.
According to Error Responses documentation of s3;
REST Error Responses
When an error occurs, the header information contains the following:
Content-Type: application/xml
An appropriate 3xx, 4xx, or 5xx HTTP status code
Also you may check list of available methods from here, as it can be seen they are all XML.

Twilio webhook sms response format

I'm using Twilio with my app and I have sms webhooks with my SMS numbers configured with URL.
Everything is working except that Twilio send me an error in logs for each requests.
I suppose that the response from my app is not well formated but I can't find on documentation how to format using JSON.
Can someone help me ? :)
Thanks,
Gabriel
Twilio developer evangelist here.
When you return a webhook message to Twilio, you need to make sure it's valid TwiML, which in essence is just a set of XML verbs Twilio uses.
If you're responding to an SMS message for example, you would return TwiML as follows:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>Thanks for getting in touch, I'll call you later</Message>
</Response>
You can test the code above by changing the configuration of your number to point to this url and you should stop seeing the errors.
If you generating the TwiML yourself, you need to make sure that the page's MIME type is text/xml.
Hope this helps you out.

SSIS connecting to CRM OData endpoint dtd error

I'm trying to use the SSIS OData Source component to connect to the CRM OData Endpoint, but it's giving me the following error:
For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method. (System.Xml)
Has anyone got this working before? Any tricks to prevent it from doing the DTD check?
The XML the service responds starts as the following:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<service xml:base="https://url.com/XRMServices/2011/OrganizationData.svc/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app">
So, the problem is that the SSIS OData Connection won't do the OAuth dance, and as such fails to cope with CRM.
What I did instead was use the RSSBus CRM component to connect.
playing with
crm online
azure active directory
ssis
C# (script component)
xml transformation
you can achieve it. Our company created a blog post for that.
sorry for not posting the whole solution here, it's kind of long
Part 1
Part 2

How pass method to PHPStorm 6 REST Client Windows Tools

Hi (Sorry for my english),
I would be use the new tools windows : REST Client in PHPStorm 6, but i have a little problem.
I write my soap url and it's ok, i retrieve the xml response (look at Heberger image http://img15.hostingpics.net/thumbs/mini_529269screen1.png).
After that i want call the method : login but i don't see how that work, how pass this method to the rest api. (look at Heberger image http://img15.hostingpics.net/thumbs/mini_696499screen2.png)
And the xml response was :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>Sender</faultcode><faultstring>Invalid XML</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Thank you for your response (and correction on my bad english :( )
Judging the response your service uses SOAP, why this client is tailored for REST. Take a look at Representational state transfer (REST) and Simple Object Access Protocol (SOAP) to get the difference.
Basically to perform the request you need to provide a properly formatted request body (which may be quite elaborate).