Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FORMAT: 1A
- HOST: http://v2salesbeta.tryoratio.com/salesapp/v2
- # Salesapp
- Salesapp endpoints.
- # Group User
- Resources related to company in the API.
- ## Login [/user/login]
- Authorization token from firebase required. Firebase uid is the same as uid in postgres.
- Authentication endpoint. User will receive a jwt token as authentication token.
- Use this authentication token in all future request. It will expire in 1 hour.
- After signing up for a user/manager is beta.oraiapp.com (dev) use Oratio-Server/test.html
- to generate a firebase jwt for this case.
- ### Login [GET]
- + Request
- + Headers
- Authorization: Basic ABCDEF
- + Response 200
- + Headers
- Authentication: `new jwt token`
- + Response 400 (application/json)
- + Body
- {
- "Error": "Invalid token"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No authorization token provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Logout [/user/logout]
- Hitting this endpoint will remove Authentication header.
- ### Logout [GET]
- + Request
- + Headers
- Authentication: `jwt token` (required, string)
- + Response 200
- ## Put User [/user/{iid}]
- + Parameters
- + iid (`b5j8bqm44tl7868u6aog`,required, string) ... invite id
- ### Put user [PUT]
- Put user in db. Firebase jwt token from user sign up should be sent with request.
- Uid from jwt is used as user uid in postgres.
- + Request (application/json)
- + Parameters
- + iid (required, string, `b5j8bqm44tl7868u6aog`) ... invitation id
- + Headers
- Authorization: `Firebase jwt-token` (required, string)
- + Attributes
- + TID: `Team ID` (required, string) - team id
- + Email : `Email` (required, string) - user email
- + Name: `Name` (required, string) - user name
- + Last Name: `LastName` (required, string) - Last name
- + Image : ` ` (optional, string) - image location as a url
- + Performance : 0 (optional, string) - Performance
- + Sessions: 0 (optional, string) - number of sessions
- + Response 200 (application/json)
- + Body
- {
- "ID" : "Generated id"
- "TID": "b5j6uim44tl2v8j06pmg",
- "Email": "bucko437@drexel.edu",
- "Name": "some-name",
- "LastName": "some-lastname",
- "Image": "some-image",
- "Performance": 0,
- "Sessions": 0
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated || Token invalid. Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No Authorization token provided || Provided user struct not correct || Email not same as invite email || NOT FOUND"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get User [/user/{uid}]
- + Parameters
- + uid (`b5j8bqm44tl7868u6aog`,required, string) ... user id
- ### Get user [GET]
- + Request (application/json)
- + Headers
- Authentication: (required, string, `jwt-token`)
- + Response 200 (application/json)
- + Body
- {
- "ID" : "b5j8bqm44tl7868u6aog"
- "TID": "b5j6uim44tl2v8j06pmg",
- "Email": "bucko437@drexel.edu",
- "Name": "some-name",
- "LastName": "some-lastname",
- "Image": "some-image",
- "Performance": 0,
- "Sessions": 0
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No user id provided || NOT FOUND"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ### Delete user [DELETE]
- Delete user from db. Cascade delete.
- + Request (application/json)
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated || Not a manager"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No user id provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Invite
- ## Send Invite [/invite]
- Send invite to new user. Invitaion email also sent. json invites array provided as input.
- ### Send invite [PUT]
- + Request
- + Headers
- Authentication: (required, string, `jwt-token`)
- + Attributes
- + TID: `team id` (required, string) ... team id
- + Email: `Email` (required, string) ... invite email
- + Response 200
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Provided invites struct not correct"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get Invite [/invite/{iid}]
- Validate a user invite in server
- + Parameters
- + iid (`b5j8bqm44tl7868u6aog`,required, string) ... inviteid
- ### Get Invite [GET]
- + Request (application/json)
- + Response 200
- + Response 401 (application/json)
- + Body
- {
- "Error": "No invite id provided || NOT FOUND"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Company
- ## Put Company [/company/{manid}]
- ### Create new company [PUT]
- Create new company. Image field not required.
- + Parameters
- + manid (`b5j8bqm44tl7868u6aog`, required, string) manager/admin id
- + Request (application/json)
- + Attributes
- + Name: `Some Name` (required, string) - company name
- + Location : `some location` (required, string) - location
- + Image: ` ` (optional, string) - image location as a url
- + WatsonID: `` (optional, string) - watson customization id
- + ManagerID : `123` (required, string) - manager id
- + Response 200 (application/json)
- + Body
- {
- "ID": "Generated - id"
- "Name": "Some Name",
- "Location": "some location",
- "Image": "",
- "WatsonID": "",
- "ManagerID" : "123"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Provided company struct not correc "
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get Company [/v2/company]
- ### Get company [GET]
- Get company with given ID.
- + Request
- + Parameters
- + cid (required, string) ... company id
- + Headers
- Authentication : `jwt-token` (required, string)
- + Response 200 (application/json)
- + Body
- {
- "ID": "Generated - id"
- "Name": "Some Name",
- "Location": "some location",
- "Image": "",
- "WatsonID": "e0d1f330-4a0f-11e7-a541-1519fa19fa4d",
- "ManagerID" : "123"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No company id provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Delete Company [/company/{cid}]
- + Parameters
- + cid (`b5j8bqm44tl7868u6aog`, required, string) cid
- ### Delete company [DELETE]
- Delete company from db. Cascade delete.
- + Request (application/json)
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No company id provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Manager
- ## Put Admin Manager [/manager/admin/{tid}]
- Put admin manager in dbduring sign up process.
- + Parameters
- + tid (`b5j8bqm44tl7868u6aog`, required, string) manager/admin id
- ### Put Manager [PUT]
- + Request (application/json)
- + Headers
- Authorization: `firebase jwt-token` (required, string)
- + Attributes
- + Name: `Name` (required, string) ... manager name
- + LastName: `Last Name` (required, string) ... manager last name
- + Email: `Email` (required, string) ... manager email
- + Response 200 (application/json)
- + Body
- {
- "ID": "Generated id"
- "Name": "Name",
- "LastName": "Last Name",
- "Email": "Email",
- "Admin": ""
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Token invalid. Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Provided manager struct not correct"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get Manager [/manager/{mid}]
- + Parameters
- + mid (string,required) - manager id
- ### Get manager [GET]
- + Request
- + Headers
- Authentication: (required, string, `jwt-token`)
- + Response 200 (application/json)
- + Body
- {
- "ID": "mid"
- "Name": "Name",
- "LastName": "Last Name",
- "Email": "Email"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Token invalid. Not authenticated || Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No manager id provided || NOT FOUND || No Authorization token provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Team
- ## Put Team [/team]
- ### Put Team [PUT]
- + Request (application/json)
- + Headers
- Authentication: `jwt-token` (required, string)
- + Attributes
- + Name: `Name` (required, string) ... team name
- + CID: `Company ID` (required, string) ... company id
- + ManagerID: `Manager ID` (required, string) .. manager id
- + Response 200 (application/json)
- + Body
- {
- "ID": "Generated id"
- "Name": "Name",
- "CID": "Company ID",
- "ManagerID" : "Manager ID"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Not a manager || Provided team struct not correct"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Delete Team [/team/{tid}]
- + Parameters
- + tid (`b5j8bqm44tl7868u6aog`, required, string) - team ID
- ### Delete team [DELETE]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Parameters
- + tid (required, string) ... team id
- + Response 200
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Not team id provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get Team Settings [/team/settings/{tid}]
- + Parameters
- + tid (string,required) - Team ID
- ### Get Team settings [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Response 200 (application/json)
- + Body
- {
- "Image": "",
- "Invited": [
- {
- "TID": "",
- "ID": "",
- "Email": "bd437@drexel.edu",
- "DateCreated": "2017-07-19T19:18:34-04:00"
- },
- {
- "TID": "",
- "ID": "",
- "Email": "bd@drexel.edu",
- "DateCreated": "2017-07-19T19:18:34-04:00"
- }
- ],
- "Members": [
- {
- "TID": "",
- "ID": "b5nuhim44tl1qrdgnvg0",
- "Email": "bucko@gmail.com",
- "Name": "Burim",
- "LastName": "Derveni",
- "Image": "",
- "Performance": 0,
- "Sessions": 0
- }
- ],
- "Name": "Orai"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Not team id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get Team Dashboard [/dashboard/{tid}]
- ### Get Team Dashboard [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Parameters
- + tid (required, string) ... team id
- + Response 200 (application/json)
- + Body
- {
- "Image": "",
- "Members": [
- {
- "TID": "",
- "ID": "b5nuhim44tl1qrdgnvg0",
- "Email": "bucko@gmail.com",
- "Name": "Burim",
- "LastName": "Derveni",
- "Image": "",
- "Performance": 0,
- "Sessions": 0
- }
- ],
- "Name": "Orai"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Not team id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Team Session Count [/team/count]
- ### Team Session Count [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Parameters
- + tid (required, string) ... team id
- + Response 200 (application/json)
- + Body
- {
- "Count": 1
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Team User Remove [/team/{tid}/{uid}]
- ### Delete User from team [DELETE]
- + Parameters
- + tid (required, string, `b5j8bqm44tl7868u6aog`) ... team id
- + uid (required, string, `b5j8bqm44tl7868u6aog`) ... user id
- + Request (application/json)
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id or session id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Product
- ## Put Product [/product]
- ### Put Product [PUT]
- + Request (application/json)
- + Headers
- Authentication: `jwt-token` (required, string)
- + Attributes
- + "TID": `TeamID` (required, string) ... team id
- + "Name": `Name` (required, string) ... team name
- + Response 200 (application/json)
- + Body
- {
- "TID": "TeamID",
- "ID": "Generated ID",
- "Name": "Name",
- "Image": ""
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Provided product struct not correct"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get Manager Product [/product/{tid}]
- + Parameters
- + tid (`b5j8bqm44tl7868u6aog`, required, string) manager/admin id
- ### Get Manager Products [GET]
- Get product for a specific team for a manager
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Response 200 (application/json)
- + Body
- {
- "Products": [
- {
- "ID": "b5nuhim44tl1qrdgnvi0",
- "Image": "",
- "Modules": [
- {
- "PID": "b5nuhim44tl1qrdgnvi0",
- "ID": "b5nuhim44tl1qrdgnvig",
- "Name": "Module1",
- "Instructions": [
- "Ins 1",
- "Ins 2"
- ],
- "Keywords": [
- "Word 1",
- "Word 2"
- ],
- "TargetTime": 5
- }
- ],
- "Name": "Sales"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Delete Product [/product/{pid}]
- + Parameters
- + pid (`b5j8bqm44tl7868u6aog`, required, string) manager/admin id
- ### Delete Product [DELETE]
- Delete product from db. Cascade delete.
- + Request (application/json)
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id or product id provided provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Module
- ## Put Module [/module]
- ### Put Module [PUT]
- + Request (application/json)
- + Headers
- Authentication: `jwt-token` (required, string)
- + Attributes
- + "PID": `ProductID` (required, string) ... product id
- + "Name": `Name` (required, string) ... module name
- + "Instructions": `["ins1", "ins2"]`(required, string) ... module instructions
- + "Keywords": `["keyw1", "keyw2"]` (required, string) ... module keywords
- + "TargetTime": `5` (required, string) ... target time in minutess
- + Response 200 (application/json)
- + Body
- {
- "Instructions": ["ins1", "ins2"],
- "Name": "Nam3",
- "PID": "ProductID",
- "TargetTime": 10,
- "ID":"Generated ID"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Provided module struct not correct"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Delete Module [/module/{mid}]
- ### Delete module [DELETE]
- Delete module from db. Cascade delete.
- + Parameters
- + mid (`b5j8bqm44tl7868u6aog`, required, string) module id
- + Request (application/json)
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id or module id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Update Module Keywords [/module/keywords/{mid}]
- ### Update module keywords [PATCH]
- Update module keywords in db. This request will replace all keywords with the newly provided ones.
- + Request (application/json)
- + Parameters
- + mid (required, string, `b5j8bqm44tl7868u6aog`) ... module id
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Body
- ["word1", "word2"]
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": " Not a manager || No module id provided || Provided keywords not correct"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Update Module Instructions [/module/instructions/{mid}]
- ### Update module instructions [PATCH]
- Update module instructions in db. This request will replace all instrucitons with the newly provided ones.
- + Parameters
- + mid (`b5j8bqm44tl7868u6aog`, required, string) module id
- + Request (application/json)
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Body
- ["ins1", "ins2"]
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": " Not a manager || No module id provided || Provided instructions not correct"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Update Module TargetTime [/module/targettime/{mid}/{mins}]
- ### Update module TargetTime [PATCH]
- Update module targettime in db.
- + Request
- + Parameters
- + mid (required, string, `b5j8bqm44tl7868u6aog`) ... module id
- + mins (required, string, `1`) ... new target time in minutes
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": " Not a manager || No module id or minutes provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Session
- ## Get User Sessions [/session/user/{uid}]
- + Parameters
- + uid (`b5j8bqm44tl7868u6aog`, required, string) user id
- ### Get User Sessions [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Response 200 (application/json)
- + Body
- [
- {
- "UID": "b5nuhim44tl1qrdgnvg0",
- "ID": "b5nuhim44tl1qrdgnvj0",
- "MID": "b5nuhim44tl1qrdgnvig",
- "Duration": 20.1,
- "Data": "String json of session data"
- }
- ]
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id or user id provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get Session [/session/{sid}]
- + Parameters
- + sid (`b5j8bqm44tl7868u6aog`, required, string) sessionid
- ### Get Session [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Parameters
- + sid (required, string) ... session id
- + Response 200 (application/json)
- + Body
- {
- "UID": "b5nuhim44tl1qrdgnvg0",
- "ID": "b5nuhim44tl1qrdgnvj0",
- "MID": "b5nuhim44tl1qrdgnvig",
- "Duration": 20.1,
- "Data": "String json of session data"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No sesion id provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## User Session Count [/user/count/{uid}]
- + Parameters
- + uid (`b5j8bqm44tl7868u6aog`, required, string)user id
- ### User Session Count [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Parameters
- + uid (required, string) ... user id
- + Response 200 (application/json)
- + Body
- {
- "Count": 1
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id or user id provided"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Delete Session [/session/{seid}]
- ### Delete session [DELETE]
- Delete session from db. Cascade delete.
- + Request (application/json)
- + Parameters
- + seid (required, string, `b5j8bqm44tl7868u6aog`) ... session id
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id or session id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Tracker
- ## Put Tracker [/tracker]
- ### Put Tracker [PUT]
- + Request (application/json)
- + Headers
- Authentication: `jwt-token` (required, string)
- + Attributes
- + "TeamID": `TeamID` (required, string) ... team id
- + "Tracker": `pricing` (required, string) ... tracker word
- + Response 200 (application/json)
- + Body
- {
- "ID": "Generated ID",
- "TeamID": "TeamID",
- "Tracker": "pricing"
- }
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Provided tracler struct not correct || Not a manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get Team Trackers [/tracker/{tid}]
- + Parameters
- + tid (`b5j8bqm44tl7868u6aog`, required, string) team id
- ### Get Team Trackers [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Parameters
- + tid (required, string) ... team id
- + Response 200 (application/json)
- + Body
- [
- {
- "ID": "TrackerID",
- "TeamID": "TeamID",
- "Tracker": "tracker word"
- }
- ]
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Delete Tracker [/tracker/{trackerid}]
- + Parameters
- + trackerid (`b5j8bqm44tl7868u6aog`, required, string) trackerid
- ### Delete tracker [DELETE]
- Delete tracker from db. Cascade delete.
- + Request (application/json)
- + Parameters
- + trackerid (required, string, `b5j8bqm44tl7868u6aog`) ... tracker id
- + Headers
- Authentication: (required, string, `jwt-token` )
- + Response 200 (application/json)
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "No team id or tracker id provided || Not team manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- # Group Instance
- ## Get Tracker Instances [/instance/{trackerid}]
- + Parameters
- + trackerid (`b5j8bqm44tl7868u6aog`, required, string) trackerid
- ### Get Tracker Instances [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Parameters
- + trackerid (required, int) ... tracker id
- + Response 200 (application/json)
- + Body
- [
- {
- "ID": 2,
- "TrackerID": "b5nuhim44tl1qrdgnvjg",
- "SessionID": "b5nuhim44tl1qrdgnvj0",
- "Instance": "Pricing was mentioned here too",
- "DateCreated": "2017-07-19T19:18:34Z"
- },
- {
- "ID": 1,
- "TrackerID": "b5nuhim44tl1qrdgnvjg",
- "SessionID": "b5nuhim44tl1qrdgnvj0",
- "Instance": "Pricing was mentioned here",
- "DateCreated": "2017-07-19T19:18:34Z"
- }
- ]
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Not tracker id provided || Not a manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
- ## Get User Tracker Instances [/instance/{trackerid}/{uid}]
- + Parameters
- + trackerid (`b5j8bqm44tl7868u6aog`, required, string) trackerid
- + userid (`b5j8bqm44tl7868u6aog`, required, string) uid
- ### Get User Tracker Instances [GET]
- + Request
- + Headers
- Authentication: `jwt-token` (required, string)
- + Parameters
- + trackerid (required, int) ... tracker id
- + uid (required, string) ... user id
- + Response 200 (application/json)
- + Body
- [
- {
- "ID": 2,
- "TrackerID": "b5nuhim44tl1qrdgnvjg",
- "SessionID": "b5nuhim44tl1qrdgnvj0",
- "Instance": "Pricing was mentioned here too",
- "DateCreated": "2017-07-19T19:18:34Z"
- },
- {
- "ID": 1,
- "TrackerID": "b5nuhim44tl1qrdgnvjg",
- "SessionID": "b5nuhim44tl1qrdgnvj0",
- "Instance": "Pricing was mentioned here",
- "DateCreated": "2017-07-19T19:18:34Z"
- }
- ]
- + Response 400 (application/json)
- + Body
- {
- "Error": "Not authenticated"
- }
- + Response 401 (application/json)
- + Body
- {
- "Error": "Not tracker id or user id provided || Not a manager"
- }
- + Response 500 (application/json)
- + Body
- {
- "Error": "Error msg"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement