- Install composer
- Install docker
- Install docker-compose
- Run
git clone [email protected]:fedoranvar/yii2-starter-kit-api.git cd myproject.com composer run-script docker:build docker-compose exec app console/yii app/setup
- Go to http://yii2-starter-kit.localhost
- Go to http://backend.yii2-starter-kit.localhost/user/index and log in with
webmaster:webmaster
- Choose user which token you want to use by clickig
eye
-icon - Copy and paste
API access_token
in request as HTTPBasicAuth username (password leave blank)
- Chat
- GET - /v1/chat - fetch all chats
- GET - /v1/chat/view?id={id} - fetch chat with id={
id
} - POST - /v1/chat/create - create new chat
- Context: [
title
]
- Context: [
- PATCH - /v1/chat/update?id={id} - Edit chat with id={
id
}- Context: [
title
]
- Context: [
- DELETE - /v1/chat/delete?id={id} - Delete (set
deleted_at
and don't show GET) chat with id={id
}
- Chat Message
- GET - /v1/chat-message - fetch all chats messages
- GET - /v1/chat-message/view?id={id} - fetch chat message with id={
id
} - POST - /v1/chat-message/create - create new chat message
- Context: [
user_id
,chat_id
,content
]
- Context: [
- PATCH - /v1/chat-message/update?id={id} - Edit chat message with id={
id
}- Context: [
content
]
- Context: [
- DELETE - /v1/chat-message/delete?id={id} - Delete (set
deleted_at
and don't show GET) chat message with id={id
}
- Chat User
- GET - /v1/chat-user - fetch all chat-users
- GET - /v1/chat-user/view?id={id} - fetch chat-user with id={
id
} - POST - /v1/chat-user/create - Join
user_id
inchat_id
- Context: [
user_id
,chat_id
]
- Context: [
- DELETE - /v1/chat-user/delete?id={id} - Remove
user_id
fromchat_id
(context taken from chat-user with id={id
})
For more details refer to: http://api.yii2-starter-kit.localhost/site/docs#/