Artica Wiki

OpenLDAP REST API

If you want to manage users through the REST API, this document allows you to send API commands to manage user accounts.

If you want to manage users through the REST API, this document allows you to send API commands to manage user accounts.

This feature is available Artica v4.50 Service Pack 7 or Artica v4.50 Service Pack 6 Hotfix 20260618-00

Standard response envelope:

HTTP status codes

Manage OpenLDAP service:

Examples:

Members

Modifiable-attribute whitelist: givenName, sn, mail, title, telephoneNumber, mobile.

Example create a member

curl -s -X POST --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock -H "Content-Type: application/json"  -d '{"login":"jdupont","password":"S3cr3t!","firstname":"Jean","lastname":"Dupont", "email":"jean.dupont@example.com","ou":"example.com","gpid":0}'  http://localhost/openldap/members  

Example update profile

curl -s -X PUT --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock -H "Content-Type: application/json" -d '{"givenName":"Jean","sn":"Dupont","mail":"j.dupont@example.com","title":"Director","telephoneNumber":"+33123456789","mobile":""}'  http://localhost/openldap/members/jdupont | jq

Example delete an user

curl -s -X DELETE --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/members/jdupont | jq

Example change password

curl -s -X POST --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock -H "Content-Type: application/json"  -d '{"password":"N3wPass!"}'  http://localhost/openldap/members/jdupont/password | jq

Groups

Example: List groups 

curl -s --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock "http://localhost/openldap/groups?ou=example.com" | jq

Example — create a group (+ optionally link a member)

curl -s -X POST --unix-socket $SOCK -H "Content-Type: application/json"  -d '{"name":"accountants","ou":"example.com","uid":"jdupont"}'  http://localhost/openldap/groups | jq

Example: Link / unlink a member from/to a group

curl -s -X POST --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/groups/5005/members/jdupont | jq

curl -s -X DELETE --unix-socket /usr/share/artica-postfix/bin/run/articarest.sock http://localhost/openldap/groups/5005/members/jdupont | jq

GET /openldap/ous:  List organizations (single OU when  Enable Multiple Organizations is disabled )