Roel Westhoff [W4]
29-Aug-2015, 05:28 AM
1.
Got a request to connect DF to Meetup.com.
http://www.meetup.com/meetup_api/auth/#keysign
Pickup the Mailchimp.wo and changed it to MeetupTest.wo
Made changes to the web and normal properties
// Web properties
Set wpsOAuth2Url to "https://secure.meetup.com/oauth2/authorize"
Set wpsClientID to "r2i0dqjsu9pjn1okg88v4s8xxx"
Set wpsRedirectUrl to "http://localhost/OAuth2/OAuth2/Callback.html"
Set wpsResponseType to "code"
// Normal properties
Set psClientSecret to "7k2p0899qr6rirc7psvdboxxxx"
Set psTokenHost to "secure.meetup.com"
Set psTokenPath to "oauth2/access"
And logged in to Meetup.com with the access_token supplied by Meetup.com after signing-up to meetup.com.
The result was getting a timestamp (no error) from meetup.com (so far so good i think)
My problem is that i get an error message after adding
https://api.meetup.com/activity?&sign=true&photo-host=public (https://secure.meetup.com/meetup_api/console/?path=/activity)
to the operations field and executing
The error messages is: {"errors":[{"code":"not_authorized_host","message":"A valid host is required"}]}
I made one small change to the LIop procedure
Procedure LIOp
String sOp sVerb sResp sToken sPath sContent
Integer iOK
WebGet wpsAccessToken of oOAuth to sToken
If (sToken = "") Begin
Send ShowInfoBox "You need to log into Meetup before testing operations" "Error"
Procedure_Return
End
WebGet psValue of oOperation to sOp
WebGet psValue of oVerb to sVerb
WebGet psValue of oContent to sContent
Move (sOp) to sPath //<<<<<
WebSet psValue of oPath to sPath
Send ClearHeaders of oLIHttp
Send Reset of oLIHttp
Get AddHeader of oLIHttp "Authorization" ("Bearer" * sToken) to iOK
// The following two calls tell the Meetup API that you want to work in JSON rather than XML
Get AddHeader of oLIHttp "x-li-format" "json" to iOK
Get AddHeader of oLIHttp "Content-type" "application/json" to iOK
Get HttpVerbAddrRequest of oLIHttp sPath (AddressOf(sContent)) (Length(sContent)) False sVerb to iOK
If iOK Begin
If ((Left(sResp, Length(C_DOCTYPE) - 1) = C_DOCTYPE) or ;
(Left(sResp, Length(C_HTMLTAG)) = C_HTMLTAG)) Begin
WebSet pbRender of oResponseText to False
WebSet pbRender of oResponseHTML to True
WebSet psHtml of oResponseHTML to (psData(oLIHttp(Self)))
End
Else Begin
WebSet pbRender of oResponseText to True
WebSet pbRender of oResponseHTML to False
WebSet psValue of oResponseText to (psData(oLIHttp(Self)))
End
End
WebSet psValue of oRemains to (GrantLeft(oOAuth(Self)))
End_Procedure
Any idea what i'm doing wrong?
2. The different views show us to access external API's and receiving a result. What i'm missing in the examples is what to do with the received data.
At the presentation of oAuth2 in the netherlands i've seen some good examples. Can these examples be added to the beta?
Roel
Got a request to connect DF to Meetup.com.
http://www.meetup.com/meetup_api/auth/#keysign
Pickup the Mailchimp.wo and changed it to MeetupTest.wo
Made changes to the web and normal properties
// Web properties
Set wpsOAuth2Url to "https://secure.meetup.com/oauth2/authorize"
Set wpsClientID to "r2i0dqjsu9pjn1okg88v4s8xxx"
Set wpsRedirectUrl to "http://localhost/OAuth2/OAuth2/Callback.html"
Set wpsResponseType to "code"
// Normal properties
Set psClientSecret to "7k2p0899qr6rirc7psvdboxxxx"
Set psTokenHost to "secure.meetup.com"
Set psTokenPath to "oauth2/access"
And logged in to Meetup.com with the access_token supplied by Meetup.com after signing-up to meetup.com.
The result was getting a timestamp (no error) from meetup.com (so far so good i think)
My problem is that i get an error message after adding
https://api.meetup.com/activity?&sign=true&photo-host=public (https://secure.meetup.com/meetup_api/console/?path=/activity)
to the operations field and executing
The error messages is: {"errors":[{"code":"not_authorized_host","message":"A valid host is required"}]}
I made one small change to the LIop procedure
Procedure LIOp
String sOp sVerb sResp sToken sPath sContent
Integer iOK
WebGet wpsAccessToken of oOAuth to sToken
If (sToken = "") Begin
Send ShowInfoBox "You need to log into Meetup before testing operations" "Error"
Procedure_Return
End
WebGet psValue of oOperation to sOp
WebGet psValue of oVerb to sVerb
WebGet psValue of oContent to sContent
Move (sOp) to sPath //<<<<<
WebSet psValue of oPath to sPath
Send ClearHeaders of oLIHttp
Send Reset of oLIHttp
Get AddHeader of oLIHttp "Authorization" ("Bearer" * sToken) to iOK
// The following two calls tell the Meetup API that you want to work in JSON rather than XML
Get AddHeader of oLIHttp "x-li-format" "json" to iOK
Get AddHeader of oLIHttp "Content-type" "application/json" to iOK
Get HttpVerbAddrRequest of oLIHttp sPath (AddressOf(sContent)) (Length(sContent)) False sVerb to iOK
If iOK Begin
If ((Left(sResp, Length(C_DOCTYPE) - 1) = C_DOCTYPE) or ;
(Left(sResp, Length(C_HTMLTAG)) = C_HTMLTAG)) Begin
WebSet pbRender of oResponseText to False
WebSet pbRender of oResponseHTML to True
WebSet psHtml of oResponseHTML to (psData(oLIHttp(Self)))
End
Else Begin
WebSet pbRender of oResponseText to True
WebSet pbRender of oResponseHTML to False
WebSet psValue of oResponseText to (psData(oLIHttp(Self)))
End
End
WebSet psValue of oRemains to (GrantLeft(oOAuth(Self)))
End_Procedure
Any idea what i'm doing wrong?
2. The different views show us to access external API's and receiving a result. What i'm missing in the examples is what to do with the received data.
At the presentation of oAuth2 in the netherlands i've seen some good examples. Can these examples be added to the beta?
Roel