1
+ <?xml version =" 1.0" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © 2016 Ihor Vansach ([email protected] ). All rights reserved.
5
+ * See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
6
+ *
7
+ * Glory to Ukraine! Glory to the heroes!
8
+ */
9
+ -->
10
+ <routes xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" ../../../../../app/code/Magento/Webapi/etc/webapi.xsd" >
11
+
12
+ <!-- Login Example to get Bearer: curl -X POST "http://mystore.com/index.php/rest/V1/integration/admin/token" \
13
+ -H "Content-Type:application/json" \
14
+ -d '{"username":"username", "password":"userpassword"}' -->
15
+
16
+ <!-- Example: curl -X POST "http://mystore.com/index.php/rest/V1/blog/post/create/" \
17
+ -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
18
+ -H "Content-Type:application/json" \
19
+ -d '{"data":"{\"param_1\":\"value_1\",\"param_2\":\"value_2\",\"param_n\":\"value_n\"}"}' -->
20
+ <route url =" /V1/blog/post/create" method =" POST" >
21
+ <service class =" Magefan\Blog\Api\PostManagementInterface" method =" create" />
22
+ <resources >
23
+ <resource ref =" Magefan_Blog::post" />
24
+ </resources >
25
+ </route >
26
+ <!-- Example: curl -X POST "http://mystore.com/index.php/rest/V1/blog/post/update/postId/" \
27
+ -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
28
+ -H "Content-Type:application/json" \
29
+ -d '{"data":"{\"param_1\":\"new_value_1\",\"param_2\":\"new_value_2\",\"param_n\":\"new_value_n\"}"}' -->
30
+ <route url =" /V1/blog/post/update/:id/" method =" POST" >
31
+ <service class =" Magefan\Blog\Api\PostManagementInterface" method =" update" />
32
+ <resources >
33
+ <resource ref =" Magefan_Blog::post" />
34
+ </resources >
35
+ </route >
36
+ <!-- Example: curl -X GET "http://mystore.com/m2_21/index.php/rest/V1/blog/post/delete/postId/" \
37
+ -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -->
38
+ <route url =" /V1/blog/post/delete/:id/" method =" GET" >
39
+ <service class =" Magefan\Blog\Api\PostManagementInterface" method =" delete" />
40
+ <resources >
41
+ <resource ref =" Magefan_Blog::post" />
42
+ </resources >
43
+ </route >
44
+ <!-- Example: curl -X POST "http://mystore.com/index.php/rest/V1/blog/category/create/" \
45
+ -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
46
+ -H "Content-Type:application/json" \
47
+ -d '{"data":"{\"param_1\":\"value_1\",\"param_2\":\"value_2\",\"param_n\":\"value_n\"}"}' -->
48
+ <route url =" /V1/blog/category/create" method =" POST" >
49
+ <service class =" Magefan\Blog\Api\CategoryManagementInterface" method =" create" />
50
+ <resources >
51
+ <resource ref =" Magefan_Blog::category" />
52
+ </resources >
53
+ </route >
54
+ <!-- Example: curl -X POST "http://mystore.com/index.php/rest/V1/blog/category/update/categoryId/" \
55
+ -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
56
+ -H "Content-Type:application/json" \
57
+ -d '{"data":"{\"param_1\":\"new_value_1\",\"param_2\":\"new_value_2\",\"param_n\":\"new_value_n\"}"}' -->
58
+ <route url =" /V1/blog/category/update/:id/" method =" POST" >
59
+ <service class =" Magefan\Blog\Api\CategoryManagementInterface" method =" update" />
60
+ <resources >
61
+ <resource ref =" Magefan_Blog::category" />
62
+ </resources >
63
+ </route >
64
+ <!-- Example: curl -X GET "http://mystore.com/m2_21/index.php/rest/V1/blog/post/category/categoryId/" \
65
+ -H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -->
66
+ <route url =" /V1/blog/category/delete/:id/" method =" GET" >
67
+ <service class =" Magefan\Blog\Api\CategoryManagementInterface" method =" delete" />
68
+ <resources >
69
+ <resource ref =" Magefan_Blog::category" />
70
+ </resources >
71
+ </route >
72
+ </routes >
0 commit comments