Any calls to the MemberClicks REST API other than the authentication call requires a token in the HTTP Authorization header.
The API supports both XML and JSON.
- Accept: application/xml
- Accept: application/json
Below is a quick description of how to use MemberClicks RESTFUL API
To get an authorization token, use a RESTFUL POST to the following link with the following body variables:
Link:
orgid.memberclicks.net/services/auth (use your orgid in place of the text orgid)
Body Variables (please note capitalization is important here):
apiKey=1111111111 (replace with your API Key)
username=myusername (replace with your user name, or leave off for public level access)
password=mypassword (replace with your password, or leave off for public level access)
The token will be included in the response.
Example: curl -d "apiKey=2406471784&username=demouser&password=demopass" https://demo.memberclicks.net/services/auth
After you have the token, add it to your header:
Header:
Authorization=8874270a-d3b2-4387-9ffd-00ebf824583c (This is not a real token, replace with the auth token you receive from the previous steps)
Once this token is added to your header, you can use Get and Put functions to the API's links to update and query your data.
API services template:
orgid.memberclicks.net/services/(service)/(method or id)
Example: curl --header "Authorization:8874270a-d3b2-4387-9ffd-00ebf824583c" https://demo.memberclicks.net/services/user/21838877
NOTE: The data in the body of the POST is required to have the MIME type application/x-www-form-urlencoded (i.e. the query in the POST body should be URL encoded to replace reserved characters).
Comments
6 comments
I tried this and I got this
HTTP Status 405 -
type Status report
message
description The specified HTTP method is not allowed for the requested resource ().
19 days later and still waiting.
THIS LINK IS NOT WORKING
Roselito and Merie - I'm sorry to hear that you're having trouble. Please send an email to help@memberclicks.com with any details you can provide on the problem you're encountering and we'll be happy to dig in further!
THis is the message I get when I CLICK on the link:
HTTP Status 401 -
type Status report
message
description This request requires HTTP authentication ().
Apache Tomcat/6.0.35
Merie - The links listed in the article above are sample calls to the API, rather than URLs to click on. Sorry for any confusion!
Roselito - It looks like your API key hasn't been generated yet. Feel free to send an email to help@memberclicks.com with the request and we'll be glad to generate one and send it your way.
Please sign in to leave a comment.