Can I use REST services to subscribe contacts?

The Addemar web service lets you embed Addemar functions in your website or application. You can add contacts, update mailgroups, evaluate a campaign, ... and much more. This can be done by connecting to our web service and simply using the methods/functions you need. The Addemar web service supports SOAP and REST.
How to make a connection
You must first retrieve a valid token (connection URL) by creating a web service user in your account under My Account >Users > New web service user.
In the examples below, we used***.
There are several possibilities to get your contacts in Addemar.
1. Submitting your form to Addemar REST service.
In this case you don't have to use server side code. Simply add the following url in the form action, choose 'post' as the form method and provide javascript validation.***
Explanation of the parameters:
profile: profile FormWS
m: method used, in this case formOptin
language: communication language of the contact (iso639_ISO3166)
retsucc: location after success
reterr: location after errors (for example a bad email address)
log_msg: a log message, for tracking the origin of the contact
All these parameters are required!
Optionally you can add this contact to 1 or more contact groups.
You can pass this information as an extra parameter. Use a comma to separate multiple contact group ids.
For example:
The form fieldnames must be the same as the fieldname in Addemar.
HTML example:
<form method="POST" action="#url#">
Email address: <input name="email"> <input type="submit" value="subscribe">
2. Using server side code to submit your contact to the Addemar REST service.
This works the same as the previous case except that server side code is used to submit de data to the Addemar REST service.
You can use your own form validation, form/error handler. This functionality can also be added to existing forms in your web application.
All the url parameters are the same, except for the return location. These urls aren't necessary anymore, instead you will receive a xml file as result.
The contact data needs to be send as POST fields/data.
Return value in case of success: contact id (integer)
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="succ">#contact_id#</rsp>
Return value in case of error: error code + message
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="fail"><err code="#error_code#" msg="error_message"/></rsp>
PHP Example with cUrl:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 4); // times out after 4s
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // add POST fields
$result = curl_exec($ch);
if (curl_errno($ch)>0){
curl_setopt($ch, CURLOPT_TIMEOUT, 7);
$result = curl_exec($ch);
if ((curl_errno($ch)>0)||(trim($result)=='')){