php bin/console doctrine:database:create
bin/console doctrine:migrations:migrate --no-interaction
bin/console fos:oauth-server:create-client --grant-type=password --grant-type=refresh_token
Note client_id
and client_secret
php bin/console server:start
curl -X POST \
{{url}}/api/v1/register \
-H 'Content-Type: application/json' \
-d '{
"username": "Ivan",
"email": "[email protected]",
"password": "123123"
}'
curl -X POST \
{{url}}/oauth/v2/token \
-H 'Content-Type: application/json' \
-d '{
"grant_type": "password",
"client_id": "{client_id}",
"client_secret": "{client_secret}",
"username": "[email protected]",
"password": "123123"
}'
Not a token
curl -X POST \
{{url}}/api/v1/todo \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \
-d '{
"title": "lol",
"description": "kek"
}'
curl -X GET \
{{url}}/api/v1/todo/list \
-H 'Authorization: Bearer {token}'
curl -X POST \
{{url}}/api/v1/todo/{task_id} \
-H 'Authorization: Bearer {token}'