Hi Clyde,

Unfortunately, we do not have classic ASP client libraries or sample
code.
The ClientLogin request will return you more than one token. For
further requests to Provisioning API, you will need to extract and use
SID token.
This token is set into the Authorization header for all further
requests.

I am not an ASP expert but tried to put something together.

PostData = "Email=" & Server.URLEncode("[EMAIL PROTECTED]")
PostData = PostData & "&Passwd=" & Server.URLEncode("XXXXXXX")
PostData = PostData & "&accountType=HOSTED"
PostData = PostData & "&service=apps"
requestXmlHttp.open "GET", "https://www.google.com/accounts/
ClientLogin?" & PostData & "", False
requestXmlHttp.send ""
response.ContentType="text/html"

'retrieve SID
tokens = Split(requestXmlHttp.responseText,"LSID=")
strMyString = Right(RTrim(tokens(0)), Len(tokens(0))-4)

strAuthorizationHeader ="GoogleLogin auth=" & strMyString

'Set appropriate headers including Auth token and retrieve all users
feed
requestXmlHttp.open "GET", "https//www.google.com/a/feeds/XXXXX.com/
user/2.0", False
requestXmlHttp.setRequestHeader "Authorization" ,
strAuthorizationHeader
requestXmlHttp.setRequestHeader "Content-type", "application/atom+xml"
requestXmlHttp.send ""
'Parse ATOM/XML

All URLs,request and response formats are available here:
http://code.google.com/apis/apps/gdata_provisioning_api_v2.0_reference.html

Also, please consider POSTing credentials to ClientLogin interface
instead of GET for security reasons.

-Anirudh

On Aug 18, 7:33 pm, clyde <[EMAIL PROTECTED]> wrote:
> Does anyone have an example of the email Provisioning API in Classic
> ASP? I am able to pass the credentials and get the Authorization back,
> but I am stumped on how to get the user listing after that. I would
> appriciate any help I can get, I really need to find a solution
> quickly. Here is a sample of my code:
>
>     PostData = "Email=" & Server.URLEncode("[EMAIL PROTECTED]")
>     PostData = PostData & "&Passwd=" & Server.URLEncode("XXXXXXX")
>     PostData = PostData & "&accountType=HOSTED"
>     PostData = PostData & "&service=apps"
>     response.Write (PostData & "<br>")
>         On Error Resume Next
>         dim requestXmlHttp : set requestXmlHttp =
> CreateObject("MSXML2.ServerXMLHTTP.3.0")
>         if requestXmlHttp Is Nothing Then
>                 set requestXmlHttp = CreateObject("Microsoft.XMLHTT P")
>                 if requestXmlHttp Is Nothing Then
>                         response.Write("Couldn't Create XMLHTTP Object.<br 
> /><br />")
>                 end if
>         end if
>     'equestXmlHttp.open "GET", "https://www.google.com/accounts/
> ClientLogin?" & PostData & "", false
>     requestXmlHttp.send ""
>
>     response.ContentType="application/atom+xml"
>     Authorization ="GoogleLogin auth=" & requestXmlHttp.responseText
>
>     requestXmlHttp.open "GET", "https://www.google.com/a/feeds/
> xxxxxxx.com/nickname/2.0/admin?" & requestXmlHttp & "", false
>     requestXmlHttp.send ""
>
>     strStatus = requestXmlHttp.Status
>     response.write(strStatus & "<BR>")
>     strRetval = requestXmlHttp.responseText
>     response.write(strRetval & "<BR>")
>
>     set requestXmlHttp = nothing
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to