Cannot retrieve data after obtaining token
Posted: Tue Mar 04, 2014 5:25 pm
I am able to retrieve the XML for an access token using the following VB6 code:
With http
.HTTPPostOption = "POST"
.Inputs.Add "client_credentials", "grant_type"
Call .SetRequestHeader("Authorization", ... my encoded key ...)
.URL = ..../3.1/auth/accesstoken" 'Circumvent the forum's "too spamy" msg
sHTML = .SendRequest()
End With
But when I try to provide the access token (extracted from the XML returned by the previous) in the next call using this code:
With http
.HTTPPostOption = "GET"
Call .SetRequestHeader("Authorization", ... my access token ...)
.URL = .../3.1/rest-services/published-data/publication/docdb/CO5540388/biblio" 'Circumvent the forum's "too spamy" msg
sHTML = .SendRequest()
Return
End With
What gets returned is <error><code>500</code><message>InvalidAccessToken</message></error>
With http
.HTTPPostOption = "POST"
.Inputs.Add "client_credentials", "grant_type"
Call .SetRequestHeader("Authorization", ... my encoded key ...)
.URL = ..../3.1/auth/accesstoken" 'Circumvent the forum's "too spamy" msg
sHTML = .SendRequest()
End With
But when I try to provide the access token (extracted from the XML returned by the previous) in the next call using this code:
With http
.HTTPPostOption = "GET"
Call .SetRequestHeader("Authorization", ... my access token ...)
.URL = .../3.1/rest-services/published-data/publication/docdb/CO5540388/biblio" 'Circumvent the forum's "too spamy" msg
sHTML = .SendRequest()
Return
End With
What gets returned is <error><code>500</code><message>InvalidAccessToken</message></error>