Is it possible to access a WebService using oAuth 2.0 from fivewin using CreateObject( "MSXML2.XmlHttp" ), I have been connecting with Carbonite using what seems to be a similar technique. I am attempting to access On-Site.com using their API's. There is some code to generate a Key and I believe this key is good for quite a while, whereas the Carbonite key needed to be generated every hour.
Sample code:
oHttp := CreateObject( "MSXML2.XmlHttp" )
hLogin["email" ] := "bhopp@matrixcomputer.com"
hLogin["password"] := "MyPassword"
cLogin := hb_JsonEncode( hLogin )
oHttp:Open( "POST","https:" + "/" + "/" + "api.carbonite.com:443/api/auth/login",.f. )
oHttp:SetRequestHeader( "Content-Type", "text/json" )
oHttp:Send( cLogin )
If oHttp:status == 200
cResponse := oHttp:ResponseText()
Logit( Mcs_AppPath() + "Request.txt",cResponse )
Else
MsgStop( "Status:" + oHttp:statusText,"Request Failed" )
Endif
oAuth 2.0 Restful Web Service
-
- Posts: 388
- Joined: Sun Nov 06, 2005 3:55 pm
- Location: Southern California, USA
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42604
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 44 times
- Been thanked: 88 times
- Contact:
-
- Posts: 388
- Joined: Sun Nov 06, 2005 3:55 pm
- Location: Southern California, USA
- Contact:
Re: oAuth 2.0 Restful Web Service
Antonio,
This works Great, I guess I am going to try it, but I saw somebody posted using oAuth 2.0 and they utilized curl, which I am not familiar with, so I was hoping this would work. I have used this technique with Authorize.net as well. For each request the API describes what the result will look like.
I downloaded the oAuth specs and it's not a pretty read.
Thanks,
Byron ..
This works Great, I guess I am going to try it, but I saw somebody posted using oAuth 2.0 and they utilized curl, which I am not familiar with, so I was hoping this would work. I have used this technique with Authorize.net as well. For each request the API describes what the result will look like.
I downloaded the oAuth specs and it's not a pretty read.
Thanks,
Byron ..
Thanks,
Byron Hopp
Matrix Computer Services
Byron Hopp
Matrix Computer Services