{ "openapi": "3.0.3", "info": { "title": "user_ldap", "version": "0.0.1", "description": "This application enables administrators to connect Nextcloud to an LDAP-based user directory.", "license": { "name": "agpl" } }, "components": { "securitySchemes": { "basic_auth": { "type": "http", "scheme": "basic" }, "bearer_auth": { "type": "http", "scheme": "bearer" } }, "schemas": { "OCSMeta": { "type": "object", "required": [ "status", "statuscode" ], "properties": { "status": { "type": "string" }, "statuscode": { "type": "integer" }, "message": { "type": "string" }, "totalitems": { "type": "string" }, "itemsperpage": { "type": "string" } } } } }, "paths": { "/ocs/v2.php/apps/user_ldap/api/v1/config": { "post": { "operationId": "configapi-create", "summary": "Create a new (empty) configuration and return the resulting prefix", "description": "This endpoint requires admin access", "tags": [ "configapi" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Config created successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "required": [ "configID" ], "properties": { "configID": { "type": "string" } } } } } } } } } } } } }, "/ocs/v2.php/apps/user_ldap/api/v1/config/{configID}": { "get": { "operationId": "configapi-show", "summary": "Get a configuration", "description": "Output can look like this: ok 200 OK ldaps://my.ldap.server 7770 ou=small,dc=my,dc=ldap,dc=server ou=users,ou=small,dc=my,dc=ldap,dc=server ou=small,dc=my,dc=ldap,dc=server cn=root,dc=my,dc=ldap,dc=server clearTextWithShowPassword=1 1 0 displayname uid inetOrgPerson (&(objectclass=nextcloudUser)(nextcloudEnabled=TRUE)) 1 (&(|(objectclass=nextcloudGroup))) 0 nextcloudGroup cn memberUid (&(|(objectclass=inetOrgPerson))(uid=%uid)) 0 0 1 mail 20 auto auto 1 uid;sn;givenname 0 1 uid uid 0 0 500 1 \nThis endpoint requires admin access", "tags": [ "configapi" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "showPassword": { "type": "boolean", "default": false, "description": "Whether to show the password" } } } } } }, "parameters": [ { "name": "configID", "in": "path", "description": "ID of the config", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Config returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": { "type": "object", "additionalProperties": { "type": "object" } } } } } } } } }, "404": { "description": "Config not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "put": { "operationId": "configapi-modify", "summary": "Modify a configuration", "description": "This endpoint requires admin access", "tags": [ "configapi" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "configData" ], "properties": { "configData": { "type": "object", "description": "New config", "additionalProperties": { "type": "object" } } } } } } }, "parameters": [ { "name": "configID", "in": "path", "description": "ID of the config", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Config returned", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } }, "400": { "description": "Modifying config is not possible", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } }, "404": { "description": "Config not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } }, "delete": { "operationId": "configapi-delete", "summary": "Delete a LDAP configuration", "description": "This endpoint requires admin access", "tags": [ "configapi" ], "security": [ { "bearer_auth": [] }, { "basic_auth": [] } ], "parameters": [ { "name": "configID", "in": "path", "description": "ID of the config", "required": true, "schema": { "type": "string" } }, { "name": "OCS-APIRequest", "in": "header", "description": "Required to be true for the API request to pass", "required": true, "schema": { "type": "boolean", "default": true } } ], "responses": { "200": { "description": "Config deleted successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } }, "404": { "description": "Config not found", "content": { "application/json": { "schema": { "type": "object", "required": [ "ocs" ], "properties": { "ocs": { "type": "object", "required": [ "meta", "data" ], "properties": { "meta": { "$ref": "#/components/schemas/OCSMeta" }, "data": {} } } } } } } } } } } }, "tags": [] }