Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. =====================================================================================================================
  2. GET AUTHORIZATION TOKEN
  3. =====================================================================================================================
  4.  
  5. @api {post} https://api.kameleoon.com/k-api/authorization Get Token
  6. @apiDescription Create temporary token using username and password from request body. Expiration in 1 hour.
  7. @apiName GetToken
  8. @apiGroup Rest_Auth
  9. @apiHeader Content-Type application/x-www-form-urlencoded
  10. @apiParam username Your user name.
  11. @apiParam password Your user password.
  12. @apiExample {curl} Example usage:
  13. curl -k -X POST \
  14. -H "Content-Type: application/x-www-form-urlencoded" \
  15. -d 'username=a@a.com&password=123456qwerty' \
  16. "https://api.kameleoon.com/k-api/authorization" \
  17. @apiSuccessExample Success-Response:
  18. HTTP/1.1 200 OK
  19. {
  20. "success": true,
  21. "error": [],
  22. "results": {
  23. "X-Auth-Key": "ABCDEF123456789",
  24. "expiration_in": 3600
  25. }
  26. }
  27.  
  28.  
  29. =====================================================================================================================
  30. SEND DATA
  31. =====================================================================================================================
  32.  
  33. @api {put} https://api.kameleoon.com/k-api/site/tealium/:id Update Tealium
  34. @apiDescription Update tealium information. The tealium id is required in the URL.
  35. @apiName PutSiteTealiumUpdate
  36. @apiGroup Site
  37. @apiHeader X-Auth-Key Token from authorization request.
  38. @apiHeader X-Auth-Email User account email.
  39. @apiParam {JsonObject} [tealiumAudience] The list of audiences created in the third-party tools Tealium AudienceStream.
  40. @apiParam {JsonObject} [tealiumBadges] The list of badges created in the third-party tools Tealium AudienceStream.
  41. @apiExample {curl} Example usage:
  42. curl -k -X PUT \
  43. -H "X-Auth-Key: ABCDEF123456789" \
  44. -H "X-Auth-Email: a@a.com" \
  45. -H "Content-Type: application/json" \
  46. -d '{
  47. "tealiumAudience":
  48. [
  49. {
  50. "id":1,
  51. "name":"test1"
  52. },
  53. {
  54. "id":2,
  55. "name":"test2"
  56. }
  57. ],
  58. "tealiumBadges":
  59. [
  60. {
  61. "id":1,
  62. "name":"test1"
  63. },
  64. {
  65. "id":2,
  66. "name":"test2"
  67. }
  68. ]
  69. }' \
  70. "https://api.kameleoon.com/k-api/site/tealium/1" \
  71. @apiSuccessExample Success-Response:
  72. HTTP/1.1 200 OK
  73. {
  74. "result": {
  75. "sites": [
  76. {
  77. "id": 1,
  78. "tealiumAudience": [
  79. {
  80. "id":1,
  81. "name":"test1"
  82. },
  83. {
  84. "id":2,
  85. "name":"test2"
  86. }
  87. ],
  88. "tealiumBadges": [
  89. {
  90. "id":1,
  91. "name":"test1"
  92. },
  93. {
  94. "id":2,
  95. "name":"test2"
  96. }
  97. ]
  98. }
  99. ]
  100. },
  101. "success": true,
  102. "errors": []
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement