I am looking for either Userservice or Rest API plugins how to add and query users by custom property tag such as phone number.
says:
properties | Yes | List of properties. Property is a key / value object. The key must to be per user unique |
Documentations is:
POST /userService/users
Endpoint to create a new user
Payload: User
Return value: HTTP status 201 (Created)
Examples
Header: Authorization: Basic YWRtaW46MTIzNDU=
Header: Content-Type: application/xml
POSThttp://example.org:9090/plugins/userService/users
Payload Example 1 (required parameters):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user><username>test3</username>
<password>p4ssword</password>
</user>
Payload Example 2 (available parameters):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user><username>testuser</username>
<password>p4ssword</password>
<name>Test User</name>
<email>test@localhost.de</email>
<properties>
<propertykey="keyname"value="value"/>
<propertykey="anotherkey"value="value"/>
</properties>
</user>
Also in REST API documentation:Endpoint to create a new user
POST /users
Payload: User
Return value: HTTP status 201 (Created)
Examples
XML Examples
Header: Authorization: Basic YWRtaW46MTIzNDU=
Header: Content-Type: application/xml
Payload Example 1 (required parameters):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user><username>test3</username>
<password>p4ssword</password>
</user>
Payload Example 2 (available parameters):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><user><username>testuser</username>
<password>p4ssword</password>
<name>Test User</name>
<email>test@localhost.de</email>
<properties>
<propertykey="phonenumber"value="1234567890"/>
<propertykey="country"value="USA"/>
</properties>
</user>
I am looking for PHP code (using cCurl ) for PHP 5.3 based all the libraries available is for PHP 5.4+. I could not get the ccurl code to work.
Code needs to be able to create username with properties and also query by properties.