Advertisement
Guest User

Untitled

a guest
Aug 31st, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.95 KB | None | 0 0
  1. FORMAT: 1A
  2. HOST: http://v2salesbeta.tryoratio.com/salesapp/v2
  3.  
  4. # Salesapp
  5.  
  6. Salesapp endpoints.
  7.  
  8. # Group User
  9.  
  10. Resources related to company in the API.
  11.  
  12. ## Login [/user/login]
  13. Authorization token from firebase required. Firebase uid is the same as uid in postgres.
  14. Authentication endpoint. User will receive a jwt token as authentication token.
  15. Use this authentication token in all future request. It will expire in 1 hour.
  16.  
  17. After signing up for a user/manager is beta.oraiapp.com (dev) use Oratio-Server/test.html
  18. to generate a firebase jwt for this case.
  19.  
  20. ### Login [GET]
  21.  
  22. + Request
  23.  
  24. + Headers
  25.  
  26. Authorization: Basic ABCDEF
  27.  
  28. + Response 200
  29.  
  30. + Headers
  31.  
  32. Authentication: `new jwt token`
  33.  
  34.  
  35. + Response 400 (application/json)
  36.  
  37. + Body
  38.  
  39. {
  40. "Error": "Invalid token"
  41. }
  42.  
  43. + Response 401 (application/json)
  44.  
  45. + Body
  46.  
  47. {
  48. "Error": "No authorization token provided"
  49. }
  50.  
  51.  
  52. + Response 500 (application/json)
  53.  
  54. + Body
  55.  
  56. {
  57. "Error": "Error msg"
  58. }
  59.  
  60. ## Logout [/user/logout]
  61. Hitting this endpoint will remove Authentication header.
  62.  
  63. ### Logout [GET]
  64.  
  65. + Request
  66.  
  67. + Headers
  68.  
  69. Authentication: `jwt token` (required, string)
  70.  
  71. + Response 200
  72.  
  73.  
  74. ## Put User [/user/{iid}]
  75.  
  76. + Parameters
  77. + iid (`b5j8bqm44tl7868u6aog`,required, string) ... invite id
  78.  
  79.  
  80. ### Put user [PUT]
  81. Put user in db. Firebase jwt token from user sign up should be sent with request.
  82. Uid from jwt is used as user uid in postgres.
  83.  
  84. + Request (application/json)
  85.  
  86. + Parameters
  87.  
  88. + iid (required, string, `b5j8bqm44tl7868u6aog`) ... invitation id
  89.  
  90. + Headers
  91.  
  92. Authorization: `Firebase jwt-token` (required, string)
  93.  
  94. + Attributes
  95.  
  96. + TID: `Team ID` (required, string) - team id
  97. + Email : `Email` (required, string) - user email
  98. + Name: `Name` (required, string) - user name
  99. + Last Name: `LastName` (required, string) - Last name
  100. + Image : ` ` (optional, string) - image location as a url
  101. + Performance : 0 (optional, string) - Performance
  102. + Sessions: 0 (optional, string) - number of sessions
  103.  
  104. + Response 200 (application/json)
  105.  
  106. + Body
  107.  
  108. {
  109. "ID" : "Generated id"
  110. "TID": "b5j6uim44tl2v8j06pmg",
  111. "Email": "bucko437@drexel.edu",
  112. "Name": "some-name",
  113. "LastName": "some-lastname",
  114. "Image": "some-image",
  115. "Performance": 0,
  116. "Sessions": 0
  117. }
  118.  
  119. + Response 400 (application/json)
  120.  
  121. + Body
  122.  
  123. {
  124. "Error": "Not authenticated || Token invalid. Not authenticated"
  125. }
  126.  
  127. + Response 401 (application/json)
  128.  
  129. + Body
  130.  
  131. {
  132. "Error": "No Authorization token provided || Provided user struct not correct || Email not same as invite email || NOT FOUND"
  133. }
  134.  
  135. + Response 500 (application/json)
  136.  
  137. + Body
  138.  
  139. {
  140. "Error": "Error msg"
  141. }
  142.  
  143. ## Get User [/user/{uid}]
  144.  
  145. + Parameters
  146. + uid (`b5j8bqm44tl7868u6aog`,required, string) ... user id
  147.  
  148. ### Get user [GET]
  149.  
  150. + Request (application/json)
  151.  
  152.  
  153. + Headers
  154.  
  155. Authentication: (required, string, `jwt-token`)
  156.  
  157. + Response 200 (application/json)
  158.  
  159. + Body
  160.  
  161. {
  162. "ID" : "b5j8bqm44tl7868u6aog"
  163. "TID": "b5j6uim44tl2v8j06pmg",
  164. "Email": "bucko437@drexel.edu",
  165. "Name": "some-name",
  166. "LastName": "some-lastname",
  167. "Image": "some-image",
  168. "Performance": 0,
  169. "Sessions": 0
  170. }
  171.  
  172. + Response 400 (application/json)
  173.  
  174. + Body
  175.  
  176. {
  177. "Error": "Not authenticated"
  178. }
  179.  
  180. + Response 401 (application/json)
  181.  
  182. + Body
  183.  
  184. {
  185. "Error": "No user id provided || NOT FOUND"
  186. }
  187.  
  188. + Response 500 (application/json)
  189.  
  190. + Body
  191.  
  192. {
  193. "Error": "Error msg"
  194. }
  195.  
  196.  
  197. ### Delete user [DELETE]
  198.  
  199. Delete user from db. Cascade delete.
  200.  
  201. + Request (application/json)
  202.  
  203. + Headers
  204. Authentication: (required, string, `jwt-token` )
  205.  
  206. + Response 200 (application/json)
  207.  
  208. + Response 400 (application/json)
  209.  
  210. + Body
  211.  
  212. {
  213. "Error": "Not authenticated || Not a manager"
  214. }
  215.  
  216. + Response 401 (application/json)
  217.  
  218. + Body
  219.  
  220. {
  221. "Error": "No user id provided"
  222. }
  223.  
  224. + Response 500 (application/json)
  225.  
  226. + Body
  227.  
  228. {
  229. "Error": "Error msg"
  230. }
  231.  
  232.  
  233. # Group Invite
  234.  
  235. ## Send Invite [/invite]
  236. Send invite to new user. Invitaion email also sent. json invites array provided as input.
  237.  
  238. ### Send invite [PUT]
  239.  
  240. + Request
  241.  
  242. + Headers
  243.  
  244. Authentication: (required, string, `jwt-token`)
  245.  
  246. + Attributes
  247.  
  248. + TID: `team id` (required, string) ... team id
  249. + Email: `Email` (required, string) ... invite email
  250.  
  251. + Response 200
  252.  
  253. + Response 400 (application/json)
  254.  
  255. + Body
  256.  
  257. {
  258. "Error": "Not authenticated"
  259. }
  260.  
  261. + Response 401 (application/json)
  262.  
  263. + Body
  264.  
  265. {
  266. "Error": "Provided invites struct not correct"
  267. }
  268.  
  269. + Response 500 (application/json)
  270.  
  271. + Body
  272.  
  273. {
  274. "Error": "Error msg"
  275. }
  276.  
  277.  
  278. ## Get Invite [/invite/{iid}]
  279. Validate a user invite in server
  280. + Parameters
  281. + iid (`b5j8bqm44tl7868u6aog`,required, string) ... inviteid
  282.  
  283. ### Get Invite [GET]
  284.  
  285. + Request (application/json)
  286.  
  287.  
  288. + Response 200
  289.  
  290. + Response 401 (application/json)
  291.  
  292. + Body
  293.  
  294. {
  295. "Error": "No invite id provided || NOT FOUND"
  296. }
  297.  
  298. + Response 500 (application/json)
  299.  
  300. + Body
  301.  
  302. {
  303. "Error": "Error msg"
  304. }
  305.  
  306. # Group Company
  307.  
  308. ## Put Company [/company/{manid}]
  309.  
  310. ### Create new company [PUT]
  311. Create new company. Image field not required.
  312.  
  313. + Parameters
  314. + manid (`b5j8bqm44tl7868u6aog`, required, string) manager/admin id
  315.  
  316.  
  317. + Request (application/json)
  318.  
  319. + Attributes
  320.  
  321. + Name: `Some Name` (required, string) - company name
  322. + Location : `some location` (required, string) - location
  323. + Image: ` ` (optional, string) - image location as a url
  324. + WatsonID: `` (optional, string) - watson customization id
  325. + ManagerID : `123` (required, string) - manager id
  326.  
  327. + Response 200 (application/json)
  328.  
  329. + Body
  330.  
  331. {
  332. "ID": "Generated - id"
  333. "Name": "Some Name",
  334. "Location": "some location",
  335. "Image": "",
  336. "WatsonID": "",
  337. "ManagerID" : "123"
  338. }
  339.  
  340.  
  341. + Response 401 (application/json)
  342.  
  343. + Body
  344.  
  345. {
  346. "Error": "Provided company struct not correc "
  347. }
  348.  
  349. + Response 500 (application/json)
  350.  
  351. + Body
  352.  
  353. {
  354. "Error": "Error msg"
  355. }
  356.  
  357.  
  358. ## Get Company [/v2/company]
  359.  
  360. ### Get company [GET]
  361. Get company with given ID.
  362.  
  363. + Request
  364.  
  365. + Parameters
  366.  
  367. + cid (required, string) ... company id
  368.  
  369. + Headers
  370.  
  371. Authentication : `jwt-token` (required, string)
  372.  
  373. + Response 200 (application/json)
  374.  
  375. + Body
  376.  
  377. {
  378. "ID": "Generated - id"
  379. "Name": "Some Name",
  380. "Location": "some location",
  381. "Image": "",
  382. "WatsonID": "e0d1f330-4a0f-11e7-a541-1519fa19fa4d",
  383. "ManagerID" : "123"
  384. }
  385.  
  386. + Response 400 (application/json)
  387.  
  388. + Body
  389.  
  390. {
  391. "Error": "Not authenticated"
  392. }
  393.  
  394. + Response 401 (application/json)
  395.  
  396. + Body
  397.  
  398. {
  399. "Error": "No company id provided"
  400. }
  401.  
  402. + Response 500 (application/json)
  403.  
  404. + Body
  405.  
  406. {
  407. "Error": "Error msg"
  408. }
  409.  
  410. ## Delete Company [/company/{cid}]
  411.  
  412. + Parameters
  413. + cid (`b5j8bqm44tl7868u6aog`, required, string) cid
  414.  
  415. ### Delete company [DELETE]
  416. Delete company from db. Cascade delete.
  417.  
  418. + Request (application/json)
  419.  
  420. + Headers
  421.  
  422. Authentication: (required, string, `jwt-token` )
  423.  
  424. + Response 200 (application/json)
  425.  
  426. + Response 400 (application/json)
  427.  
  428. + Body
  429.  
  430. {
  431. "Error": "Not authenticated"
  432. }
  433.  
  434. + Response 401 (application/json)
  435.  
  436. + Body
  437.  
  438. {
  439. "Error": "No company id provided"
  440. }
  441.  
  442. + Response 500 (application/json)
  443.  
  444. + Body
  445.  
  446. {
  447. "Error": "Error msg"
  448. }
  449.  
  450.  
  451. # Group Manager
  452.  
  453. ## Put Admin Manager [/manager/admin/{tid}]
  454.  
  455. Put admin manager in dbduring sign up process.
  456.  
  457. + Parameters
  458. + tid (`b5j8bqm44tl7868u6aog`, required, string) manager/admin id
  459.  
  460. ### Put Manager [PUT]
  461.  
  462. + Request (application/json)
  463.  
  464. + Headers
  465.  
  466. Authorization: `firebase jwt-token` (required, string)
  467.  
  468. + Attributes
  469.  
  470. + Name: `Name` (required, string) ... manager name
  471. + LastName: `Last Name` (required, string) ... manager last name
  472. + Email: `Email` (required, string) ... manager email
  473.  
  474. + Response 200 (application/json)
  475.  
  476. + Body
  477.  
  478. {
  479. "ID": "Generated id"
  480. "Name": "Name",
  481. "LastName": "Last Name",
  482. "Email": "Email",
  483. "Admin": ""
  484. }
  485.  
  486. + Response 400 (application/json)
  487.  
  488. + Body
  489.  
  490. {
  491. "Error": "Token invalid. Not authenticated"
  492. }
  493.  
  494.  
  495. + Response 401 (application/json)
  496.  
  497. + Body
  498.  
  499. {
  500. "Error": "Provided manager struct not correct"
  501. }
  502.  
  503.  
  504. + Response 500 (application/json)
  505.  
  506. + Body
  507.  
  508. {
  509. "Error": "Error msg"
  510. }
  511.  
  512. ## Get Manager [/manager/{mid}]
  513.  
  514. + Parameters
  515. + mid (string,required) - manager id
  516.  
  517. ### Get manager [GET]
  518.  
  519. + Request
  520.  
  521. + Headers
  522.  
  523. Authentication: (required, string, `jwt-token`)
  524.  
  525.  
  526. + Response 200 (application/json)
  527.  
  528. + Body
  529.  
  530. {
  531. "ID": "mid"
  532. "Name": "Name",
  533. "LastName": "Last Name",
  534. "Email": "Email"
  535. }
  536.  
  537. + Response 400 (application/json)
  538.  
  539. + Body
  540.  
  541. {
  542. "Error": "Token invalid. Not authenticated || Not authenticated"
  543. }
  544.  
  545. + Response 401 (application/json)
  546.  
  547. + Body
  548.  
  549. {
  550. "Error": "No manager id provided || NOT FOUND || No Authorization token provided"
  551. }
  552.  
  553. + Response 500 (application/json)
  554.  
  555. + Body
  556.  
  557. {
  558. "Error": "Error msg"
  559. }
  560.  
  561.  
  562. # Group Team
  563.  
  564. ## Put Team [/team]
  565.  
  566. ### Put Team [PUT]
  567.  
  568. + Request (application/json)
  569.  
  570. + Headers
  571.  
  572. Authentication: `jwt-token` (required, string)
  573.  
  574. + Attributes
  575.  
  576. + Name: `Name` (required, string) ... team name
  577. + CID: `Company ID` (required, string) ... company id
  578. + ManagerID: `Manager ID` (required, string) .. manager id
  579.  
  580. + Response 200 (application/json)
  581.  
  582. + Body
  583.  
  584. {
  585. "ID": "Generated id"
  586. "Name": "Name",
  587. "CID": "Company ID",
  588. "ManagerID" : "Manager ID"
  589. }
  590.  
  591. + Response 400 (application/json)
  592.  
  593. + Body
  594.  
  595. {
  596. "Error": "Not authenticated"
  597. }
  598.  
  599. + Response 401 (application/json)
  600.  
  601. + Body
  602.  
  603. {
  604. "Error": "Not a manager || Provided team struct not correct"
  605. }
  606.  
  607. + Response 500 (application/json)
  608.  
  609. + Body
  610.  
  611. {
  612. "Error": "Error msg"
  613. }
  614.  
  615. ## Delete Team [/team/{tid}]
  616.  
  617. + Parameters
  618. + tid (`b5j8bqm44tl7868u6aog`, required, string) - team ID
  619.  
  620. ### Delete team [DELETE]
  621.  
  622. + Request
  623.  
  624. + Headers
  625.  
  626. Authentication: `jwt-token` (required, string)
  627.  
  628. + Parameters
  629.  
  630. + tid (required, string) ... team id
  631.  
  632. + Response 200
  633.  
  634. + Response 400 (application/json)
  635.  
  636. + Body
  637.  
  638. {
  639. "Error": "Not authenticated"
  640. }
  641.  
  642. + Response 401 (application/json)
  643.  
  644. + Body
  645.  
  646. {
  647. "Error": "Not team id provided"
  648. }
  649.  
  650. + Response 500 (application/json)
  651.  
  652. + Body
  653.  
  654. {
  655. "Error": "Error msg"
  656. }
  657.  
  658. ## Get Team Settings [/team/settings/{tid}]
  659.  
  660. + Parameters
  661. + tid (string,required) - Team ID
  662.  
  663. ### Get Team settings [GET]
  664.  
  665.  
  666.  
  667. + Request
  668.  
  669. + Headers
  670.  
  671. Authentication: `jwt-token` (required, string)
  672.  
  673. + Response 200 (application/json)
  674.  
  675. + Body
  676.  
  677. {
  678. "Image": "",
  679. "Invited": [
  680. {
  681. "TID": "",
  682. "ID": "",
  683. "Email": "bd437@drexel.edu",
  684. "DateCreated": "2017-07-19T19:18:34-04:00"
  685. },
  686. {
  687. "TID": "",
  688. "ID": "",
  689. "Email": "bd@drexel.edu",
  690. "DateCreated": "2017-07-19T19:18:34-04:00"
  691. }
  692. ],
  693. "Members": [
  694. {
  695. "TID": "",
  696. "ID": "b5nuhim44tl1qrdgnvg0",
  697. "Email": "bucko@gmail.com",
  698. "Name": "Burim",
  699. "LastName": "Derveni",
  700. "Image": "",
  701. "Performance": 0,
  702. "Sessions": 0
  703. }
  704. ],
  705. "Name": "Orai"
  706. }
  707.  
  708. + Response 400 (application/json)
  709.  
  710. + Body
  711.  
  712. {
  713. "Error": "Not authenticated"
  714. }
  715.  
  716. + Response 401 (application/json)
  717.  
  718. + Body
  719.  
  720. {
  721. "Error": "Not team id provided || Not team manager"
  722. }
  723.  
  724. + Response 500 (application/json)
  725.  
  726. + Body
  727.  
  728. {
  729. "Error": "Error msg"
  730. }
  731.  
  732. ## Get Team Dashboard [/dashboard/{tid}]
  733.  
  734. ### Get Team Dashboard [GET]
  735.  
  736. + Request
  737.  
  738. + Headers
  739.  
  740. Authentication: `jwt-token` (required, string)
  741.  
  742. + Parameters
  743.  
  744. + tid (required, string) ... team id
  745.  
  746. + Response 200 (application/json)
  747.  
  748. + Body
  749.  
  750. {
  751. "Image": "",
  752. "Members": [
  753. {
  754. "TID": "",
  755. "ID": "b5nuhim44tl1qrdgnvg0",
  756. "Email": "bucko@gmail.com",
  757. "Name": "Burim",
  758. "LastName": "Derveni",
  759. "Image": "",
  760. "Performance": 0,
  761. "Sessions": 0
  762. }
  763. ],
  764. "Name": "Orai"
  765. }
  766.  
  767. + Response 400 (application/json)
  768.  
  769. + Body
  770.  
  771. {
  772. "Error": "Not authenticated"
  773. }
  774.  
  775. + Response 401 (application/json)
  776.  
  777. + Body
  778.  
  779. {
  780. "Error": "Not team id provided || Not team manager"
  781. }
  782.  
  783. + Response 500 (application/json)
  784.  
  785. + Body
  786.  
  787. {
  788. "Error": "Error msg"
  789. }
  790.  
  791. ## Team Session Count [/team/count]
  792.  
  793. ### Team Session Count [GET]
  794.  
  795. + Request
  796.  
  797. + Headers
  798.  
  799. Authentication: `jwt-token` (required, string)
  800.  
  801. + Parameters
  802.  
  803. + tid (required, string) ... team id
  804.  
  805. + Response 200 (application/json)
  806.  
  807. + Body
  808.  
  809. {
  810. "Count": 1
  811. }
  812.  
  813. + Response 400 (application/json)
  814.  
  815. + Body
  816.  
  817. {
  818. "Error": "Not authenticated"
  819. }
  820.  
  821. + Response 401 (application/json)
  822.  
  823. + Body
  824.  
  825. {
  826. "Error": "No team id provided || Not team manager"
  827. }
  828.  
  829. + Response 500 (application/json)
  830.  
  831. + Body
  832.  
  833. {
  834. "Error": "Error msg"
  835. }
  836.  
  837. ## Team User Remove [/team/{tid}/{uid}]
  838. ### Delete User from team [DELETE]
  839.  
  840.  
  841. + Parameters
  842. + tid (required, string, `b5j8bqm44tl7868u6aog`) ... team id
  843. + uid (required, string, `b5j8bqm44tl7868u6aog`) ... user id
  844.  
  845. + Request (application/json)
  846.  
  847. + Headers
  848. Authentication: (required, string, `jwt-token` )
  849.  
  850. + Response 200 (application/json)
  851.  
  852. + Response 400 (application/json)
  853.  
  854. + Body
  855.  
  856. {
  857. "Error": "Not authenticated"
  858. }
  859.  
  860. + Response 401 (application/json)
  861.  
  862. + Body
  863.  
  864. {
  865. "Error": "No team id or session id provided || Not team manager"
  866. }
  867.  
  868. + Response 500 (application/json)
  869.  
  870. + Body
  871.  
  872. {
  873. "Error": "Error msg"
  874. }
  875.  
  876.  
  877.  
  878. # Group Product
  879.  
  880. ## Put Product [/product]
  881.  
  882. ### Put Product [PUT]
  883.  
  884. + Request (application/json)
  885.  
  886. + Headers
  887.  
  888. Authentication: `jwt-token` (required, string)
  889.  
  890. + Attributes
  891.  
  892. + "TID": `TeamID` (required, string) ... team id
  893. + "Name": `Name` (required, string) ... team name
  894.  
  895. + Response 200 (application/json)
  896.  
  897. + Body
  898.  
  899. {
  900. "TID": "TeamID",
  901. "ID": "Generated ID",
  902. "Name": "Name",
  903. "Image": ""
  904. }
  905.  
  906. + Response 400 (application/json)
  907.  
  908. + Body
  909.  
  910. {
  911. "Error": "Not authenticated"
  912. }
  913.  
  914. + Response 401 (application/json)
  915.  
  916. + Body
  917.  
  918. {
  919. "Error": "Provided product struct not correct"
  920. }
  921.  
  922. + Response 500 (application/json)
  923.  
  924. + Body
  925.  
  926. {
  927. "Error": "Error msg"
  928. }
  929.  
  930. ## Get Manager Product [/product/{tid}]
  931. + Parameters
  932. + tid (`b5j8bqm44tl7868u6aog`, required, string) manager/admin id
  933.  
  934. ### Get Manager Products [GET]
  935. Get product for a specific team for a manager
  936.  
  937. + Request
  938.  
  939. + Headers
  940.  
  941. Authentication: `jwt-token` (required, string)
  942.  
  943. + Response 200 (application/json)
  944.  
  945. + Body
  946.  
  947. {
  948. "Products": [
  949. {
  950. "ID": "b5nuhim44tl1qrdgnvi0",
  951. "Image": "",
  952. "Modules": [
  953. {
  954. "PID": "b5nuhim44tl1qrdgnvi0",
  955. "ID": "b5nuhim44tl1qrdgnvig",
  956. "Name": "Module1",
  957. "Instructions": [
  958. "Ins 1",
  959. "Ins 2"
  960. ],
  961. "Keywords": [
  962. "Word 1",
  963. "Word 2"
  964. ],
  965. "TargetTime": 5
  966. }
  967. ],
  968. "Name": "Sales"
  969. }
  970.  
  971.  
  972. + Response 400 (application/json)
  973.  
  974. + Body
  975.  
  976. {
  977. "Error": "Not authenticated"
  978. }
  979.  
  980. + Response 401 (application/json)
  981.  
  982. + Body
  983.  
  984. {
  985. "Error": "No team id provided || Not team manager"
  986. }
  987.  
  988. + Response 500 (application/json)
  989.  
  990. + Body
  991.  
  992. {
  993. "Error": "Error msg"
  994. }
  995.  
  996. ## Delete Product [/product/{pid}]
  997.  
  998. + Parameters
  999. + pid (`b5j8bqm44tl7868u6aog`, required, string) manager/admin id
  1000.  
  1001. ### Delete Product [DELETE]
  1002. Delete product from db. Cascade delete.
  1003.  
  1004. + Request (application/json)
  1005. + Headers
  1006.  
  1007. Authentication: (required, string, `jwt-token` )
  1008.  
  1009. + Response 200 (application/json)
  1010.  
  1011. + Response 400 (application/json)
  1012.  
  1013. + Body
  1014.  
  1015. {
  1016. "Error": "Not authenticated"
  1017. }
  1018.  
  1019. + Response 401 (application/json)
  1020.  
  1021. + Body
  1022.  
  1023. {
  1024. "Error": "No team id or product id provided provided || Not team manager"
  1025. }
  1026.  
  1027. + Response 500 (application/json)
  1028.  
  1029. + Body
  1030.  
  1031. {
  1032. "Error": "Error msg"
  1033. }
  1034.  
  1035.  
  1036. # Group Module
  1037.  
  1038. ## Put Module [/module]
  1039.  
  1040. ### Put Module [PUT]
  1041.  
  1042. + Request (application/json)
  1043. + Headers
  1044.  
  1045. Authentication: `jwt-token` (required, string)
  1046.  
  1047. + Attributes
  1048. + "PID": `ProductID` (required, string) ... product id
  1049. + "Name": `Name` (required, string) ... module name
  1050. + "Instructions": `["ins1", "ins2"]`(required, string) ... module instructions
  1051. + "Keywords": `["keyw1", "keyw2"]` (required, string) ... module keywords
  1052. + "TargetTime": `5` (required, string) ... target time in minutess
  1053.  
  1054. + Response 200 (application/json)
  1055.  
  1056. + Body
  1057.  
  1058. {
  1059. "Instructions": ["ins1", "ins2"],
  1060. "Name": "Nam3",
  1061. "PID": "ProductID",
  1062. "TargetTime": 10,
  1063. "ID":"Generated ID"
  1064. }
  1065.  
  1066. + Response 400 (application/json)
  1067.  
  1068. + Body
  1069.  
  1070. {
  1071. "Error": "Not authenticated"
  1072. }
  1073.  
  1074. + Response 401 (application/json)
  1075.  
  1076. + Body
  1077.  
  1078. {
  1079. "Error": "Provided module struct not correct"
  1080. }
  1081.  
  1082. + Response 500 (application/json)
  1083.  
  1084. + Body
  1085.  
  1086. {
  1087. "Error": "Error msg"
  1088. }
  1089.  
  1090. ## Delete Module [/module/{mid}]
  1091.  
  1092. ### Delete module [DELETE]
  1093. Delete module from db. Cascade delete.
  1094.  
  1095. + Parameters
  1096. + mid (`b5j8bqm44tl7868u6aog`, required, string) module id
  1097.  
  1098. + Request (application/json)
  1099.  
  1100. + Headers
  1101.  
  1102. Authentication: (required, string, `jwt-token` )
  1103.  
  1104. + Response 200 (application/json)
  1105.  
  1106. + Response 400 (application/json)
  1107.  
  1108. + Body
  1109.  
  1110. {
  1111. "Error": "Not authenticated"
  1112. }
  1113.  
  1114. + Response 401 (application/json)
  1115.  
  1116. + Body
  1117.  
  1118. {
  1119. "Error": "No team id or module id provided || Not team manager"
  1120. }
  1121.  
  1122. + Response 500 (application/json)
  1123.  
  1124. + Body
  1125.  
  1126. {
  1127. "Error": "Error msg"
  1128. }
  1129.  
  1130.  
  1131. ## Update Module Keywords [/module/keywords/{mid}]
  1132.  
  1133. ### Update module keywords [PATCH]
  1134. Update module keywords in db. This request will replace all keywords with the newly provided ones.
  1135.  
  1136. + Request (application/json)
  1137.  
  1138. + Parameters
  1139. + mid (required, string, `b5j8bqm44tl7868u6aog`) ... module id
  1140.  
  1141. + Headers
  1142.  
  1143. Authentication: (required, string, `jwt-token` )
  1144.  
  1145. + Body
  1146.  
  1147. ["word1", "word2"]
  1148.  
  1149. + Response 200 (application/json)
  1150.  
  1151. + Response 400 (application/json)
  1152.  
  1153. + Body
  1154.  
  1155. {
  1156. "Error": "Not authenticated"
  1157. }
  1158.  
  1159. + Response 401 (application/json)
  1160.  
  1161. + Body
  1162.  
  1163. {
  1164. "Error": " Not a manager || No module id provided || Provided keywords not correct"
  1165. }
  1166.  
  1167. + Response 500 (application/json)
  1168.  
  1169. + Body
  1170.  
  1171. {
  1172. "Error": "Error msg"
  1173. }
  1174.  
  1175. ## Update Module Instructions [/module/instructions/{mid}]
  1176.  
  1177. ### Update module instructions [PATCH]
  1178. Update module instructions in db. This request will replace all instrucitons with the newly provided ones.
  1179.  
  1180. + Parameters
  1181. + mid (`b5j8bqm44tl7868u6aog`, required, string) module id
  1182.  
  1183. + Request (application/json)
  1184.  
  1185. + Headers
  1186.  
  1187. Authentication: (required, string, `jwt-token` )
  1188.  
  1189. + Body
  1190.  
  1191. ["ins1", "ins2"]
  1192.  
  1193. + Response 200 (application/json)
  1194.  
  1195. + Response 400 (application/json)
  1196.  
  1197. + Body
  1198.  
  1199. {
  1200. "Error": "Not authenticated"
  1201. }
  1202.  
  1203. + Response 401 (application/json)
  1204.  
  1205. + Body
  1206.  
  1207. {
  1208. "Error": " Not a manager || No module id provided || Provided instructions not correct"
  1209. }
  1210.  
  1211. + Response 500 (application/json)
  1212.  
  1213. + Body
  1214.  
  1215. {
  1216. "Error": "Error msg"
  1217. }
  1218.  
  1219. ## Update Module TargetTime [/module/targettime/{mid}/{mins}]
  1220.  
  1221. ### Update module TargetTime [PATCH]
  1222. Update module targettime in db.
  1223.  
  1224. + Request
  1225.  
  1226. + Parameters
  1227. + mid (required, string, `b5j8bqm44tl7868u6aog`) ... module id
  1228. + mins (required, string, `1`) ... new target time in minutes
  1229.  
  1230. + Headers
  1231.  
  1232. Authentication: (required, string, `jwt-token` )
  1233.  
  1234. + Response 200 (application/json)
  1235.  
  1236. + Response 400 (application/json)
  1237.  
  1238. + Body
  1239.  
  1240. {
  1241. "Error": "Not authenticated"
  1242. }
  1243.  
  1244. + Response 401 (application/json)
  1245.  
  1246. + Body
  1247.  
  1248. {
  1249. "Error": " Not a manager || No module id or minutes provided"
  1250. }
  1251.  
  1252. + Response 500 (application/json)
  1253.  
  1254. + Body
  1255.  
  1256. {
  1257. "Error": "Error msg"
  1258. }
  1259.  
  1260.  
  1261. # Group Session
  1262.  
  1263. ## Get User Sessions [/session/user/{uid}]
  1264. + Parameters
  1265. + uid (`b5j8bqm44tl7868u6aog`, required, string) user id
  1266.  
  1267. ### Get User Sessions [GET]
  1268.  
  1269. + Request
  1270.  
  1271. + Headers
  1272.  
  1273. Authentication: `jwt-token` (required, string)
  1274.  
  1275. + Response 200 (application/json)
  1276.  
  1277. + Body
  1278.  
  1279. [
  1280. {
  1281. "UID": "b5nuhim44tl1qrdgnvg0",
  1282. "ID": "b5nuhim44tl1qrdgnvj0",
  1283. "MID": "b5nuhim44tl1qrdgnvig",
  1284. "Duration": 20.1,
  1285. "Data": "String json of session data"
  1286. }
  1287. ]
  1288.  
  1289. + Response 400 (application/json)
  1290.  
  1291. + Body
  1292.  
  1293. {
  1294. "Error": "Not authenticated"
  1295. }
  1296.  
  1297. + Response 401 (application/json)
  1298.  
  1299. + Body
  1300.  
  1301. {
  1302. "Error": "No team id or user id provided"
  1303. }
  1304.  
  1305. + Response 500 (application/json)
  1306.  
  1307. + Body
  1308.  
  1309. {
  1310. "Error": "Error msg"
  1311. }
  1312.  
  1313. ## Get Session [/session/{sid}]
  1314.  
  1315. + Parameters
  1316. + sid (`b5j8bqm44tl7868u6aog`, required, string) sessionid
  1317.  
  1318. ### Get Session [GET]
  1319.  
  1320. + Request
  1321.  
  1322. + Headers
  1323.  
  1324. Authentication: `jwt-token` (required, string)
  1325.  
  1326. + Parameters
  1327.  
  1328. + sid (required, string) ... session id
  1329.  
  1330. + Response 200 (application/json)
  1331.  
  1332. + Body
  1333.  
  1334. {
  1335. "UID": "b5nuhim44tl1qrdgnvg0",
  1336. "ID": "b5nuhim44tl1qrdgnvj0",
  1337. "MID": "b5nuhim44tl1qrdgnvig",
  1338. "Duration": 20.1,
  1339. "Data": "String json of session data"
  1340. }
  1341.  
  1342. + Response 400 (application/json)
  1343.  
  1344. + Body
  1345.  
  1346. {
  1347. "Error": "Not authenticated"
  1348. }
  1349.  
  1350. + Response 401 (application/json)
  1351.  
  1352. + Body
  1353.  
  1354. {
  1355. "Error": "No sesion id provided"
  1356. }
  1357.  
  1358. + Response 500 (application/json)
  1359.  
  1360. + Body
  1361.  
  1362. {
  1363. "Error": "Error msg"
  1364. }
  1365.  
  1366. ## User Session Count [/user/count/{uid}]
  1367.  
  1368. + Parameters
  1369. + uid (`b5j8bqm44tl7868u6aog`, required, string)user id
  1370.  
  1371. ### User Session Count [GET]
  1372.  
  1373. + Request
  1374.  
  1375. + Headers
  1376.  
  1377. Authentication: `jwt-token` (required, string)
  1378.  
  1379. + Parameters
  1380.  
  1381. + uid (required, string) ... user id
  1382.  
  1383. + Response 200 (application/json)
  1384.  
  1385. + Body
  1386.  
  1387. {
  1388. "Count": 1
  1389. }
  1390.  
  1391. + Response 400 (application/json)
  1392.  
  1393. + Body
  1394.  
  1395. {
  1396. "Error": "Not authenticated"
  1397. }
  1398.  
  1399. + Response 401 (application/json)
  1400.  
  1401. + Body
  1402.  
  1403. {
  1404. "Error": "No team id or user id provided"
  1405. }
  1406.  
  1407. + Response 500 (application/json)
  1408.  
  1409. + Body
  1410.  
  1411. {
  1412. "Error": "Error msg"
  1413. }
  1414.  
  1415.  
  1416. ## Delete Session [/session/{seid}]
  1417.  
  1418. ### Delete session [DELETE]
  1419. Delete session from db. Cascade delete.
  1420.  
  1421. + Request (application/json)
  1422.  
  1423. + Parameters
  1424. + seid (required, string, `b5j8bqm44tl7868u6aog`) ... session id
  1425.  
  1426. + Headers
  1427.  
  1428. Authentication: (required, string, `jwt-token` )
  1429.  
  1430. + Response 200 (application/json)
  1431.  
  1432. + Response 400 (application/json)
  1433.  
  1434. + Body
  1435.  
  1436. {
  1437. "Error": "Not authenticated"
  1438. }
  1439.  
  1440. + Response 401 (application/json)
  1441.  
  1442. + Body
  1443.  
  1444. {
  1445. "Error": "No team id or session id provided || Not team manager"
  1446. }
  1447.  
  1448. + Response 500 (application/json)
  1449.  
  1450. + Body
  1451.  
  1452. {
  1453. "Error": "Error msg"
  1454. }
  1455.  
  1456.  
  1457. # Group Tracker
  1458.  
  1459. ## Put Tracker [/tracker]
  1460.  
  1461. ### Put Tracker [PUT]
  1462.  
  1463. + Request (application/json)
  1464.  
  1465. + Headers
  1466.  
  1467. Authentication: `jwt-token` (required, string)
  1468.  
  1469. + Attributes
  1470.  
  1471. + "TeamID": `TeamID` (required, string) ... team id
  1472. + "Tracker": `pricing` (required, string) ... tracker word
  1473.  
  1474. + Response 200 (application/json)
  1475.  
  1476. + Body
  1477.  
  1478. {
  1479. "ID": "Generated ID",
  1480. "TeamID": "TeamID",
  1481. "Tracker": "pricing"
  1482. }
  1483.  
  1484. + Response 400 (application/json)
  1485.  
  1486. + Body
  1487.  
  1488. {
  1489. "Error": "Not authenticated"
  1490. }
  1491.  
  1492. + Response 401 (application/json)
  1493.  
  1494. + Body
  1495.  
  1496. {
  1497. "Error": "Provided tracler struct not correct || Not a manager"
  1498. }
  1499.  
  1500. + Response 500 (application/json)
  1501.  
  1502. + Body
  1503.  
  1504. {
  1505. "Error": "Error msg"
  1506. }
  1507.  
  1508. ## Get Team Trackers [/tracker/{tid}]
  1509.  
  1510. + Parameters
  1511. + tid (`b5j8bqm44tl7868u6aog`, required, string) team id
  1512.  
  1513. ### Get Team Trackers [GET]
  1514.  
  1515. + Request
  1516.  
  1517. + Headers
  1518.  
  1519. Authentication: `jwt-token` (required, string)
  1520.  
  1521. + Parameters
  1522.  
  1523. + tid (required, string) ... team id
  1524.  
  1525. + Response 200 (application/json)
  1526.  
  1527. + Body
  1528.  
  1529. [
  1530. {
  1531. "ID": "TrackerID",
  1532. "TeamID": "TeamID",
  1533. "Tracker": "tracker word"
  1534. }
  1535. ]
  1536.  
  1537. + Response 400 (application/json)
  1538.  
  1539. + Body
  1540.  
  1541. {
  1542. "Error": "Not authenticated"
  1543. }
  1544.  
  1545. + Response 401 (application/json)
  1546.  
  1547. + Body
  1548.  
  1549. {
  1550. "Error": "No team id provided || Not team manager"
  1551. }
  1552.  
  1553. + Response 500 (application/json)
  1554.  
  1555. + Body
  1556.  
  1557. {
  1558. "Error": "Error msg"
  1559. }
  1560.  
  1561. ## Delete Tracker [/tracker/{trackerid}]
  1562.  
  1563. + Parameters
  1564. + trackerid (`b5j8bqm44tl7868u6aog`, required, string) trackerid
  1565.  
  1566. ### Delete tracker [DELETE]
  1567. Delete tracker from db. Cascade delete.
  1568.  
  1569. + Request (application/json)
  1570.  
  1571. + Parameters
  1572.  
  1573. + trackerid (required, string, `b5j8bqm44tl7868u6aog`) ... tracker id
  1574.  
  1575. + Headers
  1576.  
  1577. Authentication: (required, string, `jwt-token` )
  1578.  
  1579. + Response 200 (application/json)
  1580.  
  1581. + Response 400 (application/json)
  1582.  
  1583. + Body
  1584.  
  1585. {
  1586. "Error": "Not authenticated"
  1587. }
  1588.  
  1589. + Response 401 (application/json)
  1590.  
  1591. + Body
  1592.  
  1593. {
  1594. "Error": "No team id or tracker id provided || Not team manager"
  1595. }
  1596.  
  1597. + Response 500 (application/json)
  1598.  
  1599. + Body
  1600.  
  1601. {
  1602. "Error": "Error msg"
  1603. }
  1604.  
  1605.  
  1606. # Group Instance
  1607.  
  1608. ## Get Tracker Instances [/instance/{trackerid}]
  1609.  
  1610. + Parameters
  1611. + trackerid (`b5j8bqm44tl7868u6aog`, required, string) trackerid
  1612.  
  1613. ### Get Tracker Instances [GET]
  1614.  
  1615. + Request
  1616.  
  1617. + Headers
  1618.  
  1619. Authentication: `jwt-token` (required, string)
  1620.  
  1621. + Parameters
  1622.  
  1623. + trackerid (required, int) ... tracker id
  1624.  
  1625. + Response 200 (application/json)
  1626.  
  1627. + Body
  1628.  
  1629. [
  1630. {
  1631. "ID": 2,
  1632. "TrackerID": "b5nuhim44tl1qrdgnvjg",
  1633. "SessionID": "b5nuhim44tl1qrdgnvj0",
  1634. "Instance": "Pricing was mentioned here too",
  1635. "DateCreated": "2017-07-19T19:18:34Z"
  1636. },
  1637. {
  1638. "ID": 1,
  1639. "TrackerID": "b5nuhim44tl1qrdgnvjg",
  1640. "SessionID": "b5nuhim44tl1qrdgnvj0",
  1641. "Instance": "Pricing was mentioned here",
  1642. "DateCreated": "2017-07-19T19:18:34Z"
  1643. }
  1644. ]
  1645.  
  1646. + Response 400 (application/json)
  1647.  
  1648. + Body
  1649.  
  1650. {
  1651. "Error": "Not authenticated"
  1652. }
  1653.  
  1654. + Response 401 (application/json)
  1655.  
  1656. + Body
  1657.  
  1658. {
  1659. "Error": "Not tracker id provided || Not a manager"
  1660. }
  1661.  
  1662. + Response 500 (application/json)
  1663.  
  1664. + Body
  1665.  
  1666. {
  1667. "Error": "Error msg"
  1668. }
  1669.  
  1670. ## Get User Tracker Instances [/instance/{trackerid}/{uid}]
  1671.  
  1672. + Parameters
  1673. + trackerid (`b5j8bqm44tl7868u6aog`, required, string) trackerid
  1674. + userid (`b5j8bqm44tl7868u6aog`, required, string) uid
  1675.  
  1676. ### Get User Tracker Instances [GET]
  1677.  
  1678. + Request
  1679.  
  1680. + Headers
  1681.  
  1682. Authentication: `jwt-token` (required, string)
  1683.  
  1684. + Parameters
  1685.  
  1686. + trackerid (required, int) ... tracker id
  1687. + uid (required, string) ... user id
  1688.  
  1689. + Response 200 (application/json)
  1690.  
  1691. + Body
  1692.  
  1693. [
  1694. {
  1695. "ID": 2,
  1696. "TrackerID": "b5nuhim44tl1qrdgnvjg",
  1697. "SessionID": "b5nuhim44tl1qrdgnvj0",
  1698. "Instance": "Pricing was mentioned here too",
  1699. "DateCreated": "2017-07-19T19:18:34Z"
  1700. },
  1701. {
  1702. "ID": 1,
  1703. "TrackerID": "b5nuhim44tl1qrdgnvjg",
  1704. "SessionID": "b5nuhim44tl1qrdgnvj0",
  1705. "Instance": "Pricing was mentioned here",
  1706. "DateCreated": "2017-07-19T19:18:34Z"
  1707. }
  1708. ]
  1709.  
  1710. + Response 400 (application/json)
  1711.  
  1712. + Body
  1713.  
  1714. {
  1715. "Error": "Not authenticated"
  1716. }
  1717.  
  1718. + Response 401 (application/json)
  1719.  
  1720. + Body
  1721.  
  1722. {
  1723. "Error": "Not tracker id or user id provided || Not a manager"
  1724. }
  1725.  
  1726. + Response 500 (application/json)
  1727.  
  1728. + Body
  1729.  
  1730. {
  1731. "Error": "Error msg"
  1732. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement