diff --git a/composer.json b/composer.json index af8f27f..af06be9 100755 --- a/composer.json +++ b/composer.json @@ -47,11 +47,11 @@ }, "require": { "php": "^8.1", - "phplist/core": "dev-main", + "phplist/core": "dev-dev", "symfony/twig-bundle": "^6.4", "symfony/webpack-encore-bundle": "^2.2", "symfony/security-bundle": "^6.4", - "tatevikgr/rest-api-client": "dev-main" + "tatevikgr/rest-api-client": "dev-dev" }, "require-dev": { "phpunit/phpunit": "^9.5", diff --git a/openapi.json b/openapi.json index 722bd8a..e3a9333 100644 --- a/openapi.json +++ b/openapi.json @@ -4,7 +4,7 @@ "title": "phpList API Documentation", "description": "This is the OpenAPI documentation for phpList API.", "contact": { - "email": "support@phplist.com" + "email": "tatevik@phplist.com" }, "license": { "name": "AGPL-3.0-or-later", @@ -1393,10 +1393,18 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BounceView" - } + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BounceView" + } + }, + "pagination": { + "$ref": "#/components/schemas/CursorPagination" + } + }, + "type": "object" } } } @@ -4715,14 +4723,14 @@ } } }, - "/api/v2/subscribe-pages/{id}": { + "/api/v2/subscribe-pages": { "get": { "tags": [ "subscriptions" ], - "summary": "Get subscribe page", + "summary": "Get subscribe pages list", "description": "🚧 **Status: Beta** – This method is under development. Avoid using in production.", - "operationId": "390db83b1de32e07d2d52b310eb0c1ea", + "operationId": "1a89921fa5f82ce43daf2ca40dc3f954", "parameters": [ { "name": "php-auth-pw", @@ -4734,12 +4742,26 @@ } }, { - "name": "id", - "in": "path", - "description": "Subscribe page ID", - "required": true, + "name": "after_id", + "in": "query", + "description": "Last id (starting from 0)", + "required": false, "schema": { - "type": "integer" + "type": "integer", + "default": 1, + "minimum": 1 + } + }, + { + "name": "limit", + "in": "query", + "description": "Number of results per page", + "required": false, + "schema": { + "type": "integer", + "default": 25, + "maximum": 100, + "minimum": 1 } } ], @@ -4749,7 +4771,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SubscribePage" + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscribePage" + } + }, + "pagination": { + "$ref": "#/components/schemas/CursorPagination" + } + }, + "type": "object" } } } @@ -4776,13 +4809,13 @@ } } }, - "put": { + "post": { "tags": [ "subscriptions" ], - "summary": "Update subscribe page", + "summary": "Create subscribe page", "description": "🚧 **Status: Beta** – This method is under development. Avoid using in production.", - "operationId": "a82a0cbe52063758b55279ce7b96657b", + "operationId": "314286c5d8ef80c845f5dfd2d671bad3", "parameters": [ { "name": "php-auth-pw", @@ -4792,15 +4825,6 @@ "schema": { "type": "string" } - }, - { - "name": "id", - "in": "path", - "description": "Subscribe page ID", - "required": true, - "schema": { - "type": "integer" - } } ], "requestBody": { @@ -4810,12 +4834,26 @@ "schema": { "properties": { "title": { - "type": "string", - "nullable": true + "type": "string" }, "active": { "type": "boolean", "nullable": true + }, + "data": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + }, + "nullable": true } }, "type": "object" @@ -4824,8 +4862,8 @@ } }, "responses": { - "200": { - "description": "Success", + "201": { + "description": "Created", "content": { "application/json": { "schema": { @@ -4844,31 +4882,33 @@ } } }, - "404": { - "description": "Not Found", + "422": { + "description": "Validation failed", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotFoundErrorResponse" + "$ref": "#/components/schemas/ValidationErrorResponse" } } } } } - }, - "delete": { + } + }, + "/api/v2/subscribe-pages/{id}": { + "get": { "tags": [ "subscriptions" ], - "summary": "Delete subscribe page", + "summary": "Get subscribe page", "description": "🚧 **Status: Beta** – This method is under development. Avoid using in production.", - "operationId": "2881b5de1d076caa070f2b9a1c8487fe", + "operationId": "390db83b1de32e07d2d52b310eb0c1ea", "parameters": [ { "name": "php-auth-pw", "in": "header", "description": "Session key obtained from login", - "required": true, + "required": false, "schema": { "type": "string" } @@ -4884,8 +4924,15 @@ } ], "responses": { - "204": { - "description": "No Content" + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscribePage" + } + } + } }, "403": { "description": "Failure", @@ -4908,16 +4955,14 @@ } } } - } - }, - "/api/v2/subscribe-pages": { - "post": { + }, + "put": { "tags": [ "subscriptions" ], - "summary": "Create subscribe page", + "summary": "Update subscribe page", "description": "🚧 **Status: Beta** – This method is under development. Avoid using in production.", - "operationId": "314286c5d8ef80c845f5dfd2d671bad3", + "operationId": "a82a0cbe52063758b55279ce7b96657b", "parameters": [ { "name": "php-auth-pw", @@ -4927,6 +4972,15 @@ "schema": { "type": "string" } + }, + { + "name": "id", + "in": "path", + "description": "Subscribe page ID", + "required": true, + "schema": { + "type": "integer" + } } ], "requestBody": { @@ -4936,11 +4990,27 @@ "schema": { "properties": { "title": { - "type": "string" + "type": "string", + "nullable": true }, "active": { "type": "boolean", "nullable": true + }, + "data": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + }, + "nullable": true } }, "type": "object" @@ -4948,90 +5018,13 @@ } } }, - "responses": { - "201": { - "description": "Created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SubscribePage" - } - } - } - }, - "403": { - "description": "Failure", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnauthorizedResponse" - } - } - } - }, - "422": { - "description": "Validation failed", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationErrorResponse" - } - } - } - } - } - } - }, - "/api/v2/subscribe-pages/{id}/data": { - "get": { - "tags": [ - "subscriptions" - ], - "summary": "Get subscribe page data", - "description": "🚧 **Status: Beta** – This method is under development. Avoid using in production.", - "operationId": "ffe22f26936614a0e853e7c44e5a0fca", - "parameters": [ - { - "name": "php-auth-pw", - "in": "header", - "description": "Session key obtained from login", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "id", - "in": "path", - "description": "Subscribe page ID", - "required": true, - "schema": { - "type": "integer" - } - } - ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "data": { - "type": "string", - "nullable": true - } - }, - "type": "object" - } + "$ref": "#/components/schemas/SubscribePage" } } } @@ -5058,13 +5051,13 @@ } } }, - "put": { + "delete": { "tags": [ "subscriptions" ], - "summary": "Set subscribe page data item", + "summary": "Delete subscribe page", "description": "🚧 **Status: Beta** – This method is under development. Avoid using in production.", - "operationId": "a71571132947a19d862eac4baf7a98a7", + "operationId": "2881b5de1d076caa070f2b9a1c8487fe", "parameters": [ { "name": "php-auth-pw", @@ -5085,47 +5078,9 @@ } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string", - "nullable": true - } - }, - "type": "object" - } - } - } - }, "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "data": { - "type": "string", - "nullable": true - } - }, - "type": "object" - } - } - } + "204": { + "description": "No Content" }, "403": { "description": "Failure", @@ -6950,6 +6905,70 @@ } } } + }, + "/api/v2/lists/{listId}/public": { + "get": { + "tags": [ + "lists" + ], + "summary": "Gets a subscriber list.", + "description": "🚧 **Status: Beta** – This method is under development. Avoid using in production. Returns a single subscriber list with specified ID.", + "operationId": "4da85d04ec92d3dd4982c63f11f3d73e", + "parameters": [ + { + "name": "listId", + "in": "path", + "description": "List ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "integer", + "example": 1 + }, + "name": { + "type": "string", + "example": "Newsletter subscribers" + }, + "description": { + "type": "string", + "example": "Main public list", + "nullable": true + } + }, + "type": "object" + } + } + } + }, + "404": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string", + "example": "There is no list with that ID." + } + }, + "type": "object" + } + } + } + } + } + } } }, "components": { @@ -8507,6 +8526,19 @@ }, "type": "object" }, + "SubscribePageData": { + "properties": { + "key": { + "type": "string", + "example": "button" + }, + "value": { + "type": "string", + "example": "Subscribe to the selected newsletters" + } + }, + "type": "object" + }, "SubscribePage": { "properties": { "id": { @@ -8523,6 +8555,12 @@ }, "owner": { "$ref": "#/components/schemas/Administrator" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscribePageData" + } } }, "type": "object" @@ -8803,4 +8841,4 @@ "description": "lists" } ] -} +} \ No newline at end of file