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:
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:
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).