Hey guys,

i got two systems running on my server: Drupal and Piwik (open source statistik tool). The main system is drupal and i integrated some Piwik Featues into the user-accounts via the Piwik API. This works really fine.

Now i want to automate the registration process: When a user account in Drupal got created a Piwik-account should be created too. The returned authentification_token at registration in piwik should be stored in the personal user profile - There is a hidden drupal profile field which is called profile_piwiktoken.

I found the tutorial 7 - http://drupal.org/node/632140 - but just don't know how to start.

The API call to add the user is:

http://domain.com/piwik/?module=API&method=UsersManager.addUser&userLogi...''&format=PHP&prettyDisplay=true&token_auth=admintoken12345

--> UsersManager.addUser (userLogin, password, email, alias = '')

This outputs following code:
a:2:{s:6:"result";s:7:"success";s:7:"message";s:2:"ok";}

After that I can generate the personal user token:
API-Call:

http://domain.com/piwik/?module=API&method=UsersManager.getTokenAuth&use...

--> UsersManager.getTokenAuth (userLogin, md5Password)

This outputs the personal token:

s:32:"8af9abab49907995f9c1839091380915";

Can anyone give me a hint how to call this API and save the value in the user profile? This would be great.

Thanks

Stefan

Comments

mitchell’s picture

Project: Rules » Web service client
Version: 6.x-1.2 » 7.x-1.x-dev
Component: Rules Engine » Code

This may help.

PatchRanger’s picture

Category: task » support
Status: Active » Fixed

Please refer to the documentation (https://drupal.org/node/1114218) to configure the Wsclient.
Then you should just create a rule, which invokes service operation and sets the value it got as the response to profile field.

PatchRanger’s picture

(Dup)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.