{ "info": { "_postman_id": "5f7b583b-82cf-e028-7532-a5635bc897f7", "name": "poc_symfony4_apiplatform", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Login (generation token)", "item": [ { "name": "Api login with Super Admin", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "var jsonData = JSON.parse(responseBody);\r", "if(jsonData.token)\r", " postman.setEnvironmentVariable(\"token\", jsonData.token);" ] } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n\t\"username\": \"superadmin\",\n\t\"password\": \"local\"\n}" }, "url": { "raw": "{{url}}/api/login_check", "host": [ "{{url}}" ], "path": [ "api", "login_check" ] } }, "response": [] }, { "name": "Api login with Editor", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "var jsonData = JSON.parse(responseBody);\r", "if(jsonData.token)\r", " postman.setEnvironmentVariable(\"token_editor\", jsonData.token);" ] } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n\t\"username\": \"editor\",\n\t\"password\": \"local\"\n}" }, "url": { "raw": "{{url}}/api/login_check", "host": [ "{{url}}" ], "path": [ "api", "login_check" ] } }, "response": [] }, { "name": "Api login with Writer", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "var jsonData = JSON.parse(responseBody);\r", "if(jsonData.token)\r", " postman.setEnvironmentVariable(\"token_writer\", jsonData.token);" ] } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n\t\"username\": \"writer\",\n\t\"password\": \"local\"\n}" }, "url": { "raw": "{{url}}/api/login_check", "host": [ "{{url}}" ], "path": [ "api", "login_check" ] } }, "response": [] } ] }, { "name": "Blog Post", "item": [ { "name": "Api blog Posts list", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" } ], "url": { "raw": "{{url}}/api/blog_posts", "host": [ "{{url}}" ], "path": [ "api", "blog_posts" ] } }, "response": [] }, { "name": "Api blog Posts Search Post", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" } ], "url": { "raw": "{{url}}/api/blog_posts?title=Alice&content=Cat&order[title]=asc", "host": [ "{{url}}" ], "path": [ "api", "blog_posts" ], "query": [ { "key": "title", "value": "Alice" }, { "key": "content", "value": "Cat" }, { "key": "order[title]", "value": "asc" } ] } }, "response": [] }, { "name": "Api blog Posts Search Post by date", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" } ], "url": { "raw": "{{url}}/api/blog_posts?published[after]=2018-09-12&published[before]=2018-11-05&itemsPerPage=3&pagination=true", "host": [ "{{url}}" ], "path": [ "api", "blog_posts" ], "query": [ { "key": "published[after]", "value": "2018-09-12" }, { "key": "published[before]", "value": "2018-11-05" }, { "key": "itemsPerPage", "value": "3" }, { "key": "pagination", "value": "true" } ] } }, "response": [] }, { "name": "Api blog Posts Search Post by range ID", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" } ], "url": { "raw": "{{url}}/api/blog_posts?id[gt]=500&id[lt]=600&properties[]=id&properties[]=title&properties[]=author", "host": [ "{{url}}" ], "path": [ "api", "blog_posts" ], "query": [ { "key": "id[gt]", "value": "500" }, { "key": "id[lt]", "value": "600" }, { "key": "properties[]", "value": "id" }, { "key": "properties[]", "value": "title" }, { "key": "properties[]", "value": "author" } ] } }, "response": [] }, { "name": "Api Blog Post item", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/api/blog_posts/405", "host": [ "{{url}}" ], "path": [ "api", "blog_posts", "405" ] } }, "response": [ { "name": "Api Blog Post item", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{url}}/api/blog_posts/405", "host": [ "{{url}}" ], "path": [ "api", "blog_posts", "405" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "cache-control", "value": "private, must-revalidate", "name": "cache-control", "description": "" }, { "key": "connection", "value": "Upgrade, Keep-Alive", "name": "connection", "description": "" }, { "key": "content-length", "value": "707", "name": "content-length", "description": "" }, { "key": "content-type", "value": "application/ld+json; charset=utf-8", "name": "content-type", "description": "" }, { "key": "date", "value": "Wed, 19 Dec 2018 20:52:09 GMT", "name": "date", "description": "" }, { "key": "etag", "value": "\"fc1bd15df7d3bfe40422e3ae2d19eb98\"", "name": "etag", "description": "" }, { "key": "keep-alive", "value": "timeout=5, max=100", "name": "keep-alive", "description": "" }, { "key": "link", "value": "<http://localhost/mindsymfony4/public/api/docs.jsonld>; rel=\"http://www.w3.org/ns/hydra/core#apiDocumentation\"", "name": "link", "description": "" }, { "key": "server", "value": "Apache/2.4.29 (Win32) OpenSSL/1.0.2n PHP/7.2.8", "name": "server", "description": "" }, { "key": "upgrade", "value": "h2,h2c", "name": "upgrade", "description": "" }, { "key": "vary", "value": "Accept", "name": "vary", "description": "" }, { "key": "x-content-type-options", "value": "nosniff", "name": "x-content-type-options", "description": "" }, { "key": "x-debug-token", "value": "e9a2d0", "name": "x-debug-token", "description": "" }, { "key": "x-debug-token-link", "value": "http://localhost/mindsymfony4/public/_profiler/e9a2d0", "name": "x-debug-token-link", "description": "" }, { "key": "x-frame-options", "value": "deny", "name": "x-frame-options", "description": "" }, { "key": "x-powered-by", "value": "PHP/7.2.8", "name": "x-powered-by", "description": "" } ], "cookie": [], "body": "{\"@context\":\"\\/mindsymfony4\\/public\\/api\\/contexts\\/BlogPost\",\"@id\":\"\\/mindsymfony4\\/public\\/api\\/blog_posts\\/405\",\"@type\":\"BlogPost\",\"id\":405,\"title\":\"Blog Post Edited!!\",\"published\":\"2018-06-21T14:19:14+00:00\",\"content\":\"Hello there, some content to display! Additionnal info\",\"author\":{\"@id\":\"\\/mindsymfony4\\/public\\/api\\/users\\/21\",\"@type\":\"User\",\"username\":\"writer\",\"fullname\":\"Aubree\",\"name\":\"Feest\"},\"slug\":\"a-blog-post-edited\",\"comments\":[\"\\/mindsymfony4\\/public\\/api\\/comments\\/1425\",\"\\/mindsymfony4\\/public\\/api\\/comments\\/1426\",\"\\/mindsymfony4\\/public\\/api\\/comments\\/1427\"],\"images\":[{\"@id\":\"\\/mindsymfony4\\/public\\/api\\/images\\/1\",\"@type\":\"Image\",\"url\":\"\\/images\\/5c1aa8f6d1f9a961545897.jpg\"}]}" } ] }, { "name": "Api Maj BlogPost", "request": { "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" }, { "key": "Authorization", "value": "Bearer {{token_writer}}", "description": "Api token login Writer", "disabled": true }, { "key": "Authorization", "value": "Bearer {{token_editor}}", "description": "Api token login Editor", "disabled": true } ], "body": { "mode": "raw", "raw": "{\n \"title\": \"Blog Post Edited!!\",\n \"published\": \"2018-07-01T12:12:30+00:00\",\n \"content\": \"Hello there, some content to display! Additionnal info\",\n \"slug\": \"a-blog-post-edited\"\n}" }, "url": { "raw": "{{url}}/api/blog_posts/405", "host": [ "{{url}}" ], "path": [ "api", "blog_posts", "405" ] } }, "response": [] }, { "name": "Get comments from 1 BlogPost", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/api/blog_posts/607/comments", "host": [ "{{url}}" ], "path": [ "api", "blog_posts", "607", "comments" ] } }, "response": [] }, { "name": "Api Add BlogPost", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login SuperAdmin" }, { "key": "Authorization", "value": "Bearer {{token_writer}}", "description": "Api token login Writer", "disabled": true }, { "key": "Authorization", "value": "Bearer {{token_editor}}", "description": "Api token login Editor", "disabled": true } ], "body": { "mode": "raw", "raw": "{\n \"title\": \"A new blog post!\",\n \"content\": \"Hello there, some content to display!\",\n \"slug\": \"a-new-blog-post\"\n}" }, "url": { "raw": "{{url}}/api/blog_posts", "host": [ "{{url}}" ], "path": [ "api", "blog_posts" ] } }, "response": [] }, { "name": "Api Add Comment", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login SuperAdmin" }, { "key": "Authorization", "value": "Bearer {{token_writer}}", "description": "Api token login Writer", "disabled": true }, { "key": "Authorization", "value": "Bearer {{token_editor}}", "description": "Api token login Editor", "disabled": true } ], "body": { "mode": "raw", "raw": "{\r\n\t\"content\": \"It's a first comment published to this post?\",\r\n\t\"blogPost\": \"/mindsymfony4/public/api/blog_posts/432\"\r\n}" }, "url": { "raw": "{{url}}/api/comments", "host": [ "{{url}}" ], "path": [ "api", "comments" ] } }, "response": [] } ] }, { "name": "Web", "item": [ { "name": "Add BlogPost", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n\t\"title\": \"A new blog post!\",\n\t\"published\": \"2018-07-01 21:00:00\",\n\t\"content\": \"Hello there!\",\n\t\"author\": \"John Doe\",\n\t\"slug\": \"a-new-blog-post\"\n}" }, "url": { "raw": "{{url}}/blog/add", "host": [ "{{url}}" ], "path": [ "blog", "add" ] } }, "response": [] }, { "name": "Get BlogPost by Slug", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/blog/post/a-new-blog-post", "host": [ "{{url}}" ], "path": [ "blog", "post", "a-new-blog-post" ] } }, "response": [] }, { "name": "Get BlogPost by Author", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/blog/post/author/John Doe", "host": [ "{{url}}" ], "path": [ "blog", "post", "author", "John Doe" ] } }, "response": [] }, { "name": "Get BlogPost by ID", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/blog/post/8", "host": [ "{{url}}" ], "path": [ "blog", "post", "8" ] } }, "response": [] }, { "name": "Get BlogPost", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}/blog", "host": [ "{{url}}" ], "path": [ "blog" ] } }, "response": [] }, { "name": "Delete BlogPost", "request": { "method": "DELETE", "header": [], "body": { "mode": "formdata", "formdata": [] }, "url": { "raw": "{{url}}/blog/post/3", "host": [ "{{url}}" ], "path": [ "blog", "post", "3" ] } }, "response": [] } ] }, { "name": "User", "item": [ { "name": "Api Get User Info", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" }, { "key": "Authorization", "value": "Bearer {{token_writer}}", "description": "Api token login Writer", "disabled": true }, { "key": "Authorization", "value": "Bearer {{token_editor}}", "description": "Api token login Editor", "disabled": true } ], "url": { "raw": "{{url}}/api/users/34", "host": [ "{{url}}" ], "path": [ "api", "users", "34" ] } }, "response": [] }, { "name": "Api Edit user Jane Doe", "request": { "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" } ], "body": { "mode": "raw", "raw": "{\r\n\t\"username\": \"jane_doe\",\r\n\t\"email\": \"jane@doe.com\",\r\n\t\"name\": \"Janeeeeee2\",\r\n\t\"fullname\": \"Doedoe2\",\r\n\t\"password\": \"Mastlocal123\",\r\n\t\"retypePassword\": \"Mastlocal123\"\r\n}" }, "url": { "raw": "{{url}}/api/users/4", "host": [ "{{url}}" ], "path": [ "api", "users", "4" ] } }, "response": [] }, { "name": "Api Edit user writer, change PWD", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "var jsonData = JSON.parse(responseBody);\r", "if(jsonData.token)\r", " postman.setEnvironmentVariable(\"token_writer\", jsonData.token);\r", "" ] } } ], "request": { "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{token_writer}}", "description": "Api token login" } ], "body": { "mode": "raw", "raw": "{\r\n\t\"newPassword\": \"masterPassword#123\",\r\n\t\"newRetypedPassword\": \"masterPassword#123\",\r\n\t\"oldPassword\": \"local\"\r\n}" }, "url": { "raw": "{{url}}/api/users/21/reset-password", "host": [ "{{url}}" ], "path": [ "api", "users", "21", "reset-password" ] } }, "response": [] }, { "name": "Api Add user (Jane Doe)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" } ], "body": { "mode": "raw", "raw": "{\r\n\t\"username\": \"jane_doe\",\r\n\t\"email\": \"jane@doe.com\",\r\n\t\"name\": \"Janeeeeee\",\r\n\t\"fullname\": \"Doedoe\",\r\n\t\"password\": \"Mastlocal123\",\r\n\t\"retypePassword\": \"Mastlocal123\"\r\n}" }, "url": { "raw": "{{url}}/api/users", "host": [ "{{url}}" ], "path": [ "api", "users" ] } }, "response": [] }, { "name": "Register: Confirm token (Jane Doe)", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n\t\"confirmationToken\": \"i2cy188h5xDAX1LLrBMopzrJ2aactR\"\n}" }, "url": { "raw": "{{url}}/api/users/confirm", "host": [ "{{url}}" ], "path": [ "api", "users", "confirm" ] } }, "response": [] } ] }, { "name": "Images", "item": [ { "name": "Api list images", "request": { "method": "GET", "header": [], "url": { "raw": "{{url}}api/images", "host": [ "{{url}}api" ], "path": [ "images" ] } }, "response": [] }, { "name": "Api upload image", "request": { "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "file", "type": "file", "src": null } ] }, "url": { "raw": "{{url}}/api/images", "host": [ "{{url}}" ], "path": [ "api", "images" ] } }, "response": [] }, { "name": "Api Maj BlogPost Add existing image", "request": { "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" }, { "key": "Authorization", "value": "Bearer {{token_writer}}", "description": "Api token login Writer", "disabled": true }, { "key": "Authorization", "value": "Bearer {{token_editor}}", "description": "Api token login Editor", "disabled": true } ], "body": { "mode": "raw", "raw": "{\n\t\"images\": [\"/api/images/1\"]\n}" }, "url": { "raw": "{{url}}/api/blog_posts/405", "host": [ "{{url}}" ], "path": [ "api", "blog_posts", "405" ] } }, "response": [] } ] }, { "name": "Api entrypoint", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer {{token}}", "description": "Api token login" } ], "url": { "raw": "{{url}}/api", "host": [ "{{url}}" ], "path": [ "api" ] } }, "response": [] } ] }