[SOLVED] API update user profile


#1

Hello,
I would like to use pydio’s API in a PHP script, to update users profile information (eg. Name), but I don’t know how.

I’ve read these posts, which had similar thing:
https://pydio.com/forum/f/topic/empty-role-at-user-creation/
https://pydio.com/forum/f/topic/patch-users-right-api-v2/

But I don’t know how to pass the parameters for changing name, or email, etc

Someone can help me?
Thanks

EDIT: this is my attempt

$ch = curl_init();
$url = "http://url.com/api/v2/admin/people/group/subgroup/logintest";

$params = array(
	"PARAMETERS" => array(
		"AJXP_REPO_SCOPE_ALL" => array(
			"core.conf" => array(
				"USER_DISPLAY_NAME" => "New name"
			)
		)
	)
);
$params_json = json_encode($params);

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($params_json)));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params_json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH,  CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $user . ":" . $pwd);

$res = curl_exec($ch);
var_dump($res);
curl_close($ch);

This code return error “Arguments mismatch”.


#2

SOLVED using:

$url = "http://url.com/api/v2/admin/roles/AJXP_USR_/logintest";

$params = array(
	"ACL" => array(),
	"MASKS" => array(),
	"ACTIONS" => array(),
	"PARAMETERS" => array(
		"AJXP_REPO_SCOPE_ALL" => array(
			"core.conf" => array(
				"USER_DISPLAY_NAME" => "New name"
			)
		)
	),
	"APPLIES" => array()
);
...

#3