REST API
Below I show some examples requests and responses
Endpoints that not require authorization:
POST: api/login (login)
Array ( [email] => test@email.com [password] => cmsrs )
stdClass Object ( [success] => 1 [data] => stdClass Object ( [token] => eyJ0eXAiOiJK...7nhyflrqY-xA ) ) Validation: stdClass Object ( [success] => [error] => We cant find an account with this credentials. )
POST: api/comments/$pageId (create comments)
Array ( [content] => test comment - test123 )
stdClass Object ( [success] => 1 )
GET: api/comments/$pageId (read comments)
stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [content] => 111 test comment - test123 ) [1] => stdClass Object ( [content] => 222 test comment - test123 ) ) )
POST: api/contact/$lang (create a contact message)
Array ( [email] => test@example.com [message] => test message - test123 )
stdClass Object ( [success] => 1 [message] => Thank you for using the contact form )
GET: api/page/$pageId/$lang (get page)
stdClass Object ( [success] => 1 [data] => stdClass Object ( [id] => 1 [type] => cms [images] => Array ( [0] => stdClass Object ( [org] => /images/page/1/1/phpunittest1.jpg [small] => /images/page/1/1/phpunittest1-small.jpg [medium] => /images/page/1/1/phpunittest1-medium.jpg [id] => 1 [alt] => stdClass Object ( [en] => description img1 ) [altlang] => description img1 ) [1] => stdClass Object ( [org] => /images/page/1/2/phpunittest2.jpg [small] => /images/page/1/2/phpunittest2-small.jpg [medium] => /images/page/1/2/phpunittest2-medium.jpg [id] => 2 [alt] => stdClass Object ( [en] => ) [altlang] => ) ) ) )
GET: api/productsGetNameAndPrice/$lang (get all products, api use in basket)
stdClass Object ( [success] => 1 [data] => stdClass Object ( [1] => stdClass Object ( [price] => 123 [name] => php3 db app [url_product] => /cms/books/programmer/php3-db-app [url_image] => /images/product/1/1/phpunittest1-small.jpg ) [2] => stdClass Object ( [price] => 123 [name] => product name uniq en2 [url_product] => /cms/books/programmer/product-name-uniq-en2 [url_image] => /images/product/2/3/phpunittest1-small.jpg ) ) )
Endpoints that require authorization:
Pages:
POST: api/pages?token=$token (create page)
Array ( [title] => Array ( [en] => test p2 ) [short_title] => Array ( [en] => p22 ) [description] => Array ( [en] => test1234 ) [published] => 0 [commented] => 0 [after_login] => 0 [type] => contact [content] => Array ( [en] => lorem ipsum ) [menu_id] => [page_id] => [images] => Array ( [0] => Array ( [name] => phpunittest1.jpg [data] => data:image/jpg;base64,/9j/4AAQSkZ..rAFS6G7Jr1PeP/9k= [alt] => Array ( [en] => description img1 ) ) [1] => Array ( [name] => phpunittest2.jpg [data] => data:image/jpg;base64,/9j/4AAQSkZJRg...wRV82DVqaZSCAev/Z ) ) )
stdClass Object ( [success] => 1 [data] => stdClass Object ( [pageId] => 1 [data] => stdClass Object ( [title] => stdClass Object ( [en] => test p2 ) [short_title] => stdClass Object ( [en] => p22 ) [description] => stdClass Object ( [en] => test1234 ) [published] => 0 [commented] => 0 [after_login] => 0 [type] => contact [content] => stdClass Object ( [en] => lorem ipsum ) [menu_id] => [page_id] => [images] => Array ( [0] => stdClass Object ( [name] => phpunittest1.jpg [data] => data:image/jpg;base64,/9j/4AA....WTrAFS6G7Jr1PeP/9k= [alt] => stdClass Object ( [en] => description img1 ) ) [1] => stdClass Object ( [name] => phpunittest2.jpg [data] => data:image/jpg;base64,/9j/4A...DVqaZSCAev/Z ) ) ) ) )
GET: api/pages?token=$token (read pages)
stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 1 [published] => 0 [commented] => 0 [after_login] => 0 [position] => 1 [type] => contact [menu_id] => [page_id] => [title] => stdClass Object ( [en] => test p2 ) [short_title] => stdClass Object ( [en] => p22 ) [description] => stdClass Object ( [en] => test1234 ) [content] => stdClass Object ( [en] => lorem ipsum ) [images] => Array ( [0] => stdClass Object ( [id] => 1 [name] => phpunittest1.jpg [position] => 1 [page_id] => 1 [product_id] => [created_at] => 2020-11-20T15:38:20.000000Z [updated_at] => 2020-11-20T15:38:20.000000Z [alt] => stdClass Object ( [en] => description img1 ) [fs] => stdClass Object ( [org] => /images/page/1/1/phpunittest1.jpg [small] => /images/page/1/1/phpunittest1-small.jpg [medium] => /images/page/1/1/phpunittest1-medium.jpg ) ) [1] => stdClass Object ( [id] => 2 [name] => phpunittest2.jpg [position] => 2 [page_id] => 1 [product_id] => [created_at] => 2020-11-20T15:38:20.000000Z [updated_at] => 2020-11-20T15:38:20.000000Z [alt] => stdClass Object ( [en] => ) [fs] => stdClass Object ( [org] => /images/page/1/2/phpunittest2.jpg [small] => /images/page/1/2/phpunittest2-small.jpg [medium] => /images/page/1/2/phpunittest2-medium.jpg ) ) ) ) ) )
GET: api/pages/$pageId/{?$simple}?token=$token (get page by Id, if simple exist then we not show images)
stdClass Object ( [success] => 1 [data] => stdClass Object ( [id] => 1 [published] => 0 [commented] => 0 [after_login] => 0 [position] => 1 [type] => contact [menu_id] => [page_id] => [title] => stdClass Object ( [en] => test p2 ) [short_title] => stdClass Object ( [en] => p22 ) [description] => stdClass Object ( [en] => test1234 ) [content] => stdClass Object ( [en] => lorem ipsum ) [images] => Array ( [0] => stdClass Object ( [id] => 1 [name] => phpunittest1.jpg [position] => 1 [page_id] => 1 [product_id] => [created_at] => 2024-04-24T17:39:06.000000Z [updated_at] => 2024-04-24T17:39:06.000000Z [alt] => stdClass Object ( [en] => description img1 ) [fs] => stdClass Object ( [org] => /images/page/1/1/phpunittest1.jpg [small] => /images/page/1/1/phpunittest1-small.jpg [medium] => /images/page/1/1/phpunittest1-medium.jpg ) ) [1] => stdClass Object ( [id] => 2 [name] => phpunittest2.jpg [position] => 2 [page_id] => 1 [product_id] => [created_at] => 2024-04-24T17:39:06.000000Z [updated_at] => 2024-04-24T17:39:06.000000Z [alt] => stdClass Object ( [en] => ) [fs] => stdClass Object ( [org] => /images/page/1/2/phpunittest2.jpg [small] => /images/page/1/2/phpunittest2-small.jpg [medium] => /images/page/1/2/phpunittest2-medium.jpg ) ) ) ) )
PUT: api/pages/$id?token=$token (update page)
Array ( [title] => Array ( [en] => Update img Title ) [short_title] => Array ( [en] => test123 ) [images] => Array ( [0] => Array ( [id] => 1 [alt] => Array ( [en] => alt1 ) ) [1] => Array ( [id] => 2 [alt] => Array ( [en] => alt2 ) ) [2] => Array ( [name] => phpunittest2.jpg [data] => data:image/jpg;base64,/9j/4A...V82DVqaZSCAev/Z ) [3] => Array ( [name] => phpunittest2.jpg [data] => data:image/jpg;base64,/9j/4AA...xuwRV82DVqaZSCAev/Z ) ) )
only for existing images Array ( [title] => Array ( [en] => Update2 img Title ) [short_title] => Array ( [en] => u2 test123 ) [images] => Array ( [0] => Array ( [id] => 1 [alt] => Array ( [en] => last ) [position] => 202 ) [1] => Array ( [id] => 2 [alt] => Array ( [en] => first ) [position] => 101 ) ) )
stdClass Object ( [success] => 1 )
DELETE: api/pages/$id?token=$token (delete page)
stdClass Object ( [success] => 1 )
PATCH: api/pages/position/$direction/$id?token=$token (set page posittion, where $direction: up, down)
stdClass Object ( [success] => 1 )
GET: api/pages/type/$type (get pages base on type, where $type: cms, gallery, shop, contact, main_page, privacy_policy, login, projects)
stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 1 [published] => 0 [commented] => 0 [after_login] => 0 [position] => 1 [type] => shop [menu_id] => [page_id] => [title] => stdClass Object ( [en] => test p2 ) [short_title] => stdClass Object ( [en] => p22 ) [description] => stdClass Object ( [en] => ) [content] => stdClass Object ( [en] => aaa ffdfds ) [images] => Array ( ) ) ) )
Images:
POST: api/image/$type/$objId?token=$token (image upload, where $type: page, product, $objId: pageId, productId)
Array ( [name] => phpunittest2.jpg [data] => data:image/jpg;base64,/9j/4AAQSkZJRgABAQ..ev/Z ) stdClass Object ( [success] => 1 )
GET: api/images/$type/$objId?token=$token (get images, where $type: page, product, $objId: pageId, productId)
stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 1 [name] => phpunittest1.jpg [position] => 1 [page_id] => 1 [product_id] => [created_at] => 2020-11-22T16:38:46.000000Z [updated_at] => 2020-11-22T16:38:46.000000Z [alt] => stdClass Object ( [en] => description img1 ) [fs] => stdClass Object ( [org] => /images/page/1/1/phpunittest1.jpg [small] => /images/page/1/1/phpunittest1-small.jpg [medium] => /images/page/1/1/phpunittest1-medium.jpg ) ) [1] => stdClass Object ( [id] => 2 [name] => phpunittest2.jpg [position] => 2 [page_id] => 1 [product_id] => [created_at] => 2020-11-22T16:38:46.000000Z [updated_at] => 2020-11-22T16:38:46.000000Z [alt] => stdClass Object ( [en] => ) [fs] => stdClass Object ( [org] => /images/page/1/2/phpunittest2.jpg [small] => /images/page/1/2/phpunittest2-small.jpg [medium] => /images/page/1/2/phpunittest2-medium.jpg ) ) ) )
PATCH: api/images/position/$direction/$id?token=$token (set image position, where $direction: up, down)
stdClass Object ( [success] => 1 )
DELETE: api/images/$ids?token=$token (delete images, where $ids can be multiple IDs, e.g., 1,7,9)
stdClass Object ( [success] => 1 )
Clients:
GET: api/users/clients?token=$token (get clients)
stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 3 [name] => Robert Test [email] => rob@unittest.com [created_at] => 2020-11-22T16:52:28.000000Z [updated_at] => 2020-11-22T16:52:28.000000Z ) ) )
GET: api/clients/$column/$direction?token=$token&search=abc
get clients with pagination, searching (by name or email) and sorting where $column: id, name, email, created_at, updated_at $direction: asc, desc
get clients with pagination, searching (by name or email) and sorting where $column: id, name, email, created_at, updated_at $direction: asc, desc
stdClass Object ( [success] => 1 [data] => stdClass Object ( [current_page] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 4 [name] => Fake Kowalski [email] => sth@abc-example.com [email_verified_at] => [role] => client [created_at] => 2024-04-01T10:33:02.000000Z [updated_at] => 2024-04-01T10:33:02.000000Z ) [1] => stdClass Object ( [id] => 3 [name] => First Abc Kowalski [email] => fake@example.com [email_verified_at] => [role] => client [created_at] => 2024-04-01T10:33:02.000000Z [updated_at] => 2024-04-01T10:33:02.000000Z ) ) [first_page_url] => http://127.0.0.1:8000/api/clients/id/desc?page=1 [from] => 1 [last_page] => 1 [last_page_url] => http://127.0.0.1:8000/api/clients/id/desc?page=1 [links] => Array ( [0] => stdClass Object ( [url] => [label] => « Previous [active] => ) [1] => stdClass Object ( [url] => http://127.0.0.1:8000/api/clients/id/desc?page=1 [label] => 1 [active] => 1 ) [2] => stdClass Object ( [url] => [label] => Next » [active] => ) ) [next_page_url] => [path] => http://127.0.0.1:8000/api/clients/id/desc [per_page] => 10 [prev_page_url] => [to] => 2 [total] => 2 ) )
POST: api/clients/$id?token=$token (create client)
Array ( [name] => test client [email] => test_client_uniq@cmsrs.pl [password] => secretPass123$ [password_confirmation] => secretPass123$ ) stdClass Object ( [success] => 1 [data] => stdClass Object ( [userId] => 5 ) ) Validation: stdClass Object ( [success] => [error] => stdClass Object ( [name] => Array ( [0] => The name field is required. ) [email] => Array ( [0] => The email has already been taken. ) [password] => Array ( [0] => The password must be at least 8 characters. [1] => The password confirmation does not match. ) ) )
PUT: api/clients/$id?token=$token (edit client - without ability update email)
Array ( [name] => test client_new [password] => secretPass123$_new [password_confirmation] => secretPass123$_new ) stdClass Object ( [success] => 1 [data] => stdClass Object ( [userId] => 5 ) )
DELETE: api/clients/$id?token=$token (delete client)
stdClass Object ( [success] => 1 )
GET: api/clients/$id?token=$token (show given client)
stdClass Object ( [success] => 1 [data] => stdClass Object ( [id] => 2 [name] => Robert Test [email] => rob@unittest.com [email_verified_at] => [role] => client [created_at] => 2024-04-04T09:50:48.000000Z [updated_at] => 2024-04-04T09:50:48.000000Z ) )
Menus:
Products:
POST: api/products?token=$token (create product)
Array ( [product_name] => Array ( [en] => php3 db app ) [sku] => AN/34534 [price] => 123 [product_description] => Array ( [en] => book desc ) [page_id] => 1 [images] => Array ( [0] => Array ( [name] => phpunittest1.jpg [data] => data:image/jpg;base64,/9j/4A.....AFS6G7Jr1PeP/9k= [alt] => Array ( [en] => description img1 - product image ) ) [1] => Array ( [name] => phpunittest2.jpg [data] => data:image/jpg;base64,/9j/4AAQSkZ....qaZSCAev/Z ) ) )
stdClass Object ( [success] => 1 [data] => stdClass Object ( [productId] => 1 [data] => stdClass Object ( [product_name] => stdClass Object ( [en] => php3 db app ) [sku] => AN/34534 [price] => 123 [product_description] => stdClass Object ( [en] => book desc ) [page_id] => 1 [images] => Array ( [0] => stdClass Object ( [name] => phpunittest1.jpg [data] => data:image/jpg;base64,/9j/4AAQSkZJ....rAFS6G7Jr1PeP/9k= [alt] => stdClass Object ( [en] => description img1 - product image ) ) [1] => stdClass Object ( [name] => phpunittest2.jpg [data] => data:image/jpg;base64,/9j/4AAQSkZJRg....82DVqaZSCAev/Z ) ) ) ) )
Validation: stdClass Object ( [success] => [error] => stdClass Object ( [sku] => Array ( [0] => The sku has already been taken. ) [price] => Array ( [0] => The price must be an integer. [1] => The price field is required. ) ) ) stdClass Object ( [success] => [error] => stdClass Object ( [product_name] => Duplicate product name: php3 db app (en) ) )
GET: api/products?token=$token (get products)
stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 1 [sku] => AN/34534 [price] => 123 [page_id] => 1 [product_name] => stdClass Object ( [en] => php3 db app ) [product_description] => stdClass Object ( [en] => book desc ) [product_name_default_lang] => php3 db app [images] => Array ( [0] => stdClass Object ( [id] => 1 [name] => phpunittest1.jpg [position] => 1 [page_id] => [product_id] => 1 [created_at] => 2021-01-20T21:21:36.000000Z [updated_at] => 2021-01-20T21:21:36.000000Z [alt] => stdClass Object ( [en] => description img1 - product image ) [fs] => stdClass Object ( [org] => /images/product/1/1/phpunittest1.jpg [small] => /images/product/1/1/phpunittest1-small.jpg [medium] => /images/product/1/1/phpunittest1-medium.jpg ) ) [1] => stdClass Object ( [id] => 2 [name] => phpunittest2.jpg [position] => 2 [page_id] => [product_id] => 1 [created_at] => 2021-01-20T21:21:36.000000Z [updated_at] => 2021-01-20T21:21:36.000000Z [alt] => stdClass Object ( [en] => ) [fs] => stdClass Object ( [org] => /images/product/1/2/phpunittest2.jpg [small] => /images/product/1/2/phpunittest2-small.jpg [medium] => /images/product/1/2/phpunittest2-medium.jpg ) ) ) ) ) )
GET: api/products/$id?token=$token (get given product)
stdClass Object ( [success] => 1 [data] => stdClass Object ( [id] => 1 [published] => 1 [sku] => AN/34534_1 [price] => 101 [page_id] => 1 [product_name] => stdClass Object ( [en] => php3 db app_1 ) [product_name_slug] => stdClass Object ( [en] => php3-db-app-1 ) [product_description] => stdClass Object ( [en] => book desc_1 ) [product_name_default_lang] => php3 db app_1 [images] => Array ( [0] => stdClass Object ( [id] => 1 [name] => phpunittest1.jpg [position] => 1 [page_id] => [product_id] => 1 [created_at] => 2024-04-25T16:54:10.000000Z [updated_at] => 2024-04-25T16:54:10.000000Z [alt] => stdClass Object ( [en] => description img1 - product image ) [fs] => stdClass Object ( [org] => /images/product/1/1/phpunittest1.jpg [small] => /images/product/1/1/phpunittest1-small.jpg [medium] => /images/product/1/1/phpunittest1-medium.jpg ) ) [1] => stdClass Object ( [id] => 2 [name] => phpunittest2.jpg [position] => 2 [page_id] => [product_id] => 1 [created_at] => 2024-04-25T16:54:10.000000Z [updated_at] => 2024-04-25T16:54:10.000000Z [alt] => stdClass Object ( [en] => ) [fs] => stdClass Object ( [org] => /images/product/1/2/phpunittest2.jpg [small] => /images/product/1/2/phpunittest2-small.jpg [medium] => /images/product/1/2/phpunittest2-medium.jpg ) ) ) ) )
PUT: api/products/$id?token=$token (update product)
Array ( [product_name] => Array ( [en] => PHP7 ) [sku] => AN/34534 [price] => 123 [product_description] => Array ( [en] => PHP7 - desc ) [page_id] => 1 [images] => Array ( [0] => Array ( [id] => 1 [name] => phpunittest1.jpg [position] => 1 [page_id] => [product_id] => 1 [created_at] => 2021-01-20T21:31:20.000000Z [updated_at] => 2021-01-20T21:31:20.000000Z [alt] => Array ( [en] => alt1 ) [fs] => stdClass Object ( [org] => /images/product/1/1/phpunittest1.jpg [small] => /images/product/1/1/phpunittest1-small.jpg [medium] => /images/product/1/1/phpunittest1-medium.jpg ) ) [1] => Array ( [id] => 2 [name] => phpunittest2.jpg [position] => 2 [page_id] => [product_id] => 1 [created_at] => 2021-01-20T21:31:20.000000Z [updated_at] => 2021-01-20T21:31:20.000000Z [alt] => Array ( [en] => alt2 ) [fs] => stdClass Object ( [org] => /images/product/1/2/phpunittest2.jpg [small] => /images/product/1/2/phpunittest2-small.jpg [medium] => /images/product/1/2/phpunittest2-medium.jpg ) ) [2] => Array ( [name] => phpunittest2.jpg [data] => data:image/jpg;base64,/9j/4AAQSkZJRgA...VqaZSCAev/Z ) ) )
only for existing images Array ( [product_name] => Array ( [en] => Update2 img Title ) [sku] => sku/23423 [price] => 1111 [page_id] => 1 [images] => Array ( [0] => Array ( [id] => 6 [alt] => Array ( [en] => last ) [position] => 202 ) [1] => Array ( [id] => 7 [alt] => Array ( [en] => first ) [position] => 101 ) [2] => Array ( [id] => 8 [alt] => Array ( [en] => middle ) [position] => 155 ) ) )
stdClass Object ( [success] => 1 )
DELETE: api/products/$id?token=$token (delete product)
stdClass Object ( [success] => 1 )
GET: api/products/pagination/$lang/$column/$direction?token=$token&search=app_1
get products - with pagination, searching (by product_name or sku) and sorting, where : $column: id, published, product_name, page_short_title, sku, price, created_at, updated_at $direction: asc, desc
get products - with pagination, searching (by product_name or sku) and sorting, where : $column: id, published, product_name, page_short_title, sku, price, created_at, updated_at $direction: asc, desc
stdClass Object ( [success] => 1 [data] => stdClass Object ( [current_page] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 1 [sku] => AN/34534_1 [price] => 101 [published] => 1 [page_id] => 1 [created_at] => 2024-05-07T16:51:24.000000Z [updated_at] => 2024-05-07T16:51:24.000000Z [product_name] => php3 db app_1 [page_short_title] => page1 [images] => Array ( [0] => stdClass Object ( [id] => 1 [name] => phpunittest1.jpg [position] => 1 [page_id] => [product_id] => 1 [created_at] => 2024-05-07T16:51:24.000000Z [updated_at] => 2024-05-07T16:51:24.000000Z [alt] => stdClass Object ( [en] => description img1 - product image ) [fs] => stdClass Object ( [org] => /images/product/1/1/phpunittest1.jpg [small] => /images/product/1/1/phpunittest1-small.jpg [medium] => /images/product/1/1/phpunittest1-medium.jpg ) ) [1] => stdClass Object ( [id] => 2 [name] => phpunittest2.jpg [position] => 2 [page_id] => [product_id] => 1 [created_at] => 2024-05-07T16:51:24.000000Z [updated_at] => 2024-05-07T16:51:24.000000Z [alt] => stdClass Object ( [en] => ) [fs] => stdClass Object ( [org] => /images/product/1/2/phpunittest2.jpg [small] => /images/product/1/2/phpunittest2-small.jpg [medium] => /images/product/1/2/phpunittest2-medium.jpg ) ) ) ) [1] => stdClass Object ( [id] => 3 [sku] => app_1_1 [price] => 201 [published] => 0 [page_id] => 2 [created_at] => 2024-05-07T16:51:24.000000Z [updated_at] => 2024-05-07T16:51:24.000000Z [product_name] => php3 db app 2_1 [page_short_title] => page2 [images] => Array ( [0] => stdClass Object ( [id] => 5 [name] => phpunittest1.jpg [position] => 1 [page_id] => [product_id] => 3 [created_at] => 2024-05-07T16:51:24.000000Z [updated_at] => 2024-05-07T16:51:24.000000Z [alt] => stdClass Object ( [en] => description img1 - product image ) [fs] => stdClass Object ( [org] => /images/product/3/5/phpunittest1.jpg [small] => /images/product/3/5/phpunittest1-small.jpg [medium] => /images/product/3/5/phpunittest1-medium.jpg ) ) [1] => stdClass Object ( [id] => 6 [name] => phpunittest2.jpg [position] => 2 [page_id] => [product_id] => 3 [created_at] => 2024-05-07T16:51:24.000000Z [updated_at] => 2024-05-07T16:51:24.000000Z [alt] => stdClass Object ( [en] => ) [fs] => stdClass Object ( [org] => /images/product/3/6/phpunittest2.jpg [small] => /images/product/3/6/phpunittest2-small.jpg [medium] => /images/product/3/6/phpunittest2-medium.jpg ) ) ) ) ) [first_page_url] => http://127.0.0.1:8000/api/products/pagination/en/sku/asc?page=1 [from] => 1 [last_page] => 1 [last_page_url] => http://127.0.0.1:8000/api/products/pagination/en/sku/asc?page=1 [links] => Array ( [0] => stdClass Object ( [url] => [label] => « Previous [active] => ) [1] => stdClass Object ( [url] => http://127.0.0.1:8000/api/products/pagination/en/sku/asc?page=1 [label] => 1 [active] => 1 ) [2] => stdClass Object ( [url] => [label] => Next » [active] => ) ) [next_page_url] => [path] => http://127.0.0.1:8000/api/products/pagination/en/sku/asc [per_page] => 10 [prev_page_url] => [to] => 2 [total] => 2 ) )
Contacts:
GET: api/contacts?token=$token (get contact messages)
stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 1 [email] => test@example.com [message] => test message - test1 [created_at_format] => 2020-11-23 15:40:14 ) [1] => stdClass Object ( [id] => 2 [email] => ja@cmsrs.pl [message] => test2 [created_at_format] => 2020-11-23 15:40:14 ) ) )
DELETE: api/contacts/$id?token=$token (delete contact message)
stdClass Object ( [success] => 1 )
GET: api/contacts/pagination/$column/$direction?token=$token&search=abc
get contacts message with pagination, searching (by message or email) and sorting where $column: id, message, email, created_at, updated_at $direction: asc, desc
get contacts message with pagination, searching (by message or email) and sorting where $column: id, message, email, created_at, updated_at $direction: asc, desc
stdClass Object ( [success] => 1 [data] => stdClass Object ( [current_page] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 2 [email] => tt@cmsrs.pl [message] => test contact abc [created_at] => 2024-05-23T11:21:56.000000Z [updated_at] => 2024-05-23T11:21:56.000000Z ) [1] => stdClass Object ( [id] => 1 [email] => abc@cmsrs.pl [message] => test contact message [created_at] => 2024-05-23T11:21:56.000000Z [updated_at] => 2024-05-23T11:21:56.000000Z ) ) [first_page_url] => http://127.0.0.1:8000/api/contacts/pagination/id/desc?page=1 [from] => 1 [last_page] => 1 [last_page_url] => http://127.0.0.1:8000/api/contacts/pagination/id/desc?page=1 [links] => Array ( [0] => stdClass Object ( [url] => [label] => « Previous [active] => ) [1] => stdClass Object ( [url] => http://127.0.0.1:8000/api/contacts/pagination/id/desc?page=1 [label] => 1 [active] => 1 ) [2] => stdClass Object ( [url] => [label] => Next » [active] => ) ) [next_page_url] => [path] => http://127.0.0.1:8000/api/contacts/pagination/id/desc [per_page] => 10 [prev_page_url] => [to] => 2 [total] => 2 ) )
Settings:
GET: api/config?token=$token (get config values)
stdClass Object ( [success] => 1 [data] => stdClass Object ( [page_types] => Array ( [0] => cms [1] => gallery [2] => shop [3] => contact [4] => main_page [5] => privacy_policy ) [langs] => Array ( [0] => en ) [cache_enable] => 1 [is_cache_enable] => [default_lang] => en [currency] => EUR [demo_status] => [is_shop] => 1 ) )
PUT: api/config/clearcache?token=$token (clear cache)
stdClass Object ( [success] => 1 )
POST: api/config/toggle-cache-enable-file?token=$token (toggle cache_enable_file; if (success == true) => clear cache)
action = 'enable' or 'disable' Array ( [action] => enable ) stdClass Object ( [success] => 1 [data] => stdClass Object ( [value] => 1 [message] => Cache enabled ) ) Validation: stdClass Object ( [success] => [error] => stdClass Object ( [toggle_cache_enable_file] => Cache was already enabled ) )
GET: api/config/is-cache-enable?token=$token (check cache; is_cache_enable=cache_enable (in config) && file_exist(cache_enable_file))
stdClass Object ( [success] => 1 [data] => stdClass Object ( [is_cache_enable] => ) )
PUT: api/config/createsitemap?token=$token (create or update sitemap)
stdClass Object ( [success] => 1 )
Checkouts:
GET: api/checkouts?token=$token (we collect orders placed with the contents of the basket)
stdClass Object ( [success] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 1 [price_total] => 1829 [price_deliver] => 14 [price_total_add_deliver] => 1843 [user_id] => 1 [email] => client@cmsrs.pl [first_name] => Jan [last_name] => Kowalski [address] => kolejowa 1 m 2 [country] => Polska [city] => Warszawa [telephone] => 1234567123 [postcode] => 03-456 [is_pay] => 0 [created_at] => 2021-06-18T16:20:05.000000Z [baskets] => Array ( [0] => stdClass Object ( [qty] => 2 [price] => 112 [product_id] => 1 [product_name] => name11 [product_url] => /cms/books/programmer/name11 ) [1] => stdClass Object ( [qty] => 5 [price] => 321 [product_id] => 2 [product_name] => name22 [product_url] => /cms/books/programmer/name22 ) ) ) ) )
GET: api/checkouts/pagination/$lang/$column/$direction?token=$token&search=client3 (get checkouts with pagination, searching (by email) and sorting where: $column: id, price_total_add_deliver, created_at, updated_at $direction: asc, desc)
stdClass Object ( [success] => 1 [data] => stdClass Object ( [current_page] => 1 [data] => Array ( [0] => stdClass Object ( [id] => 4 [price_total] => 3128 [price_deliver] => 14 [price_total_add_deliver] => 3142 [user_id] => 2 [email] => client3@cmsrs.pl [first_name] => Jan [last_name] => Kowalski [address] => kolejowa 3 m 2 [country] => Polska [city] => Warszawa [telephone] => 1234567123 [postcode] => 03-456 [is_pay] => [created_at] => 2024-06-17T12:11:48.000000Z [baskets] => Array ( [0] => stdClass Object ( [qty] => 5 [price] => 112 [product_id] => 1 [product_name] => name11 [product_url] => /cms/books/programmer/name11 ) [1] => stdClass Object ( [qty] => 8 [price] => 321 [product_id] => 2 [product_name] => name22 [product_url] => /cms/books/programmer/name22 ) ) ) [1] => stdClass Object ( [id] => 31 [price_total] => 14819 [price_deliver] => 14 [price_total_add_deliver] => 14833 [user_id] => 2 [email] => client30@cmsrs.pl [first_name] => Jan [last_name] => Kowalski [address] => kolejowa 30 m 2 [country] => Polska [city] => Warszawa [telephone] => 1234567123 [postcode] => 03-456 [is_pay] => [created_at] => 2024-06-17T12:11:48.000000Z [baskets] => Array ( [0] => stdClass Object ( [qty] => 32 [price] => 112 [product_id] => 1 [product_name] => name11 [product_url] => /cms/books/programmer/name11 ) [1] => stdClass Object ( [qty] => 35 [price] => 321 [product_id] => 2 [product_name] => name22 [product_url] => /cms/books/programmer/name22 ) ) ) ) [first_page_url] => http://127.0.0.1:8000/api/checkouts/pagination/en/price_total_add_deliver/asc?page=1 [from] => 1 [last_page] => 1 [last_page_url] => http://127.0.0.1:8000/api/checkouts/pagination/en/price_total_add_deliver/asc?page=1 [links] => Array ( [0] => stdClass Object ( [url] => [label] => « Previous [active] => ) [1] => stdClass Object ( [url] => http://127.0.0.1:8000/api/checkouts/pagination/en/price_total_add_deliver/asc?page=1 [label] => 1 [active] => 1 ) [2] => stdClass Object ( [url] => [label] => Next » [active] => ) ) [next_page_url] => [path] => http://127.0.0.1:8000/api/checkouts/pagination/en/price_total_add_deliver/asc [per_page] => 10 [prev_page_url] => [to] => 2 [total] => 2 ) )
PATCH: api/checkouts/$id?token=$token (checkout update, in particular the is_pay field)
Array ( [is_pay] => 1 )
stdClass Object ( [success] => 1 )
Other APIs:
GET: api/logout?token=$token (logout)
stdClass Object ( [success] => 1 [message] => You have successfully logged out. )