ghiobi / tally-ticketsystem

Making Expensing Better Than Great Again
MIT License
1 stars 0 forks source link

API Endpoints in Tally Ticketing #96

Closed ghiobi closed 5 years ago

ghiobi commented 5 years ago

Tokens

For posting or getting for Tally Ticketing, you require a token for authenticating the request.

For example: GET Request

https://tallyticket.com/organization/[organization]/api/tickets/[id]?token?=[token]

POST Request

{
    token: [token],
    ...
}

Available endpoints

@miisaka @n2chao

Name

Url: BLA Description: BLABLA Example:

(GET) User tickets

URL: /organization/{organization}/api/tickets/user/{user_id} Description: Retrieve all tickets belonging to a user Example:

/organization/tally/api/tickets/user/2

[
   {
      "id":1,
      "user_id":2,
      "assigned_to":null,
      "title":"Nu osde kam gasevug cu.",
      "status":"submitted",
      "created_at":"2019-02-05 16:45:33",
      "updated_at":"2019-02-05 16:45:33"
   },
   {
      "id":4,
      "user_id":2,
      "assigned_to":null,
      "title":"Eguira wupufu noc jege et.",
      "status":"replied",
      "created_at":"2019-02-05 16:45:33",
      "updated_at":"2019-02-05 16:45:33"
   }
]

(GET) Single Ticket

URL: /organization/{organization}/api/tickets/{ticket_id} Description: A ticket with all the messages and details belonging to it Example:

/organization/tally/api/tickets/1

{
   "id":1,
   "user_id":2,
   "assigned_to":null,
   "title":"Nu osde kam gasevug cu.",
   "status":"submitted",
   "created_at":"2019-02-05 16:45:33",
   "updated_at":"2019-02-05 16:45:33",
   "messages":[
      {
         "id":1,
         "user_id":1,
         "ticket_id":1,
         "body":"Hello this is my message.",
         "created_at":"2019-02-05 16:45:33",
         "updated_at":"02/05/2019 4:45 PM",
         "user":{
            "id":1,
            "name":"Owner",
            "email":"owner@tally.com",
            "organization_id":1,
            "external_id":"6XLOVu8$xhnUg7MR",
            "external_access_token":"GAbqz68$x3PSH",
            "created_at":"2019-02-05 16:45:32",
            "updated_at":"2019-02-05 16:45:32"
         }
      },
      {
         "id":2,
         "user_id":2,
         "ticket_id":1,
         "body":"Hello this is another message",
         "created_at":"2019-02-05 16:45:33",
         "updated_at":"02/05/2019 4:45 PM",
         "user":{
            "id":2,
            "name":"user",
            "email":"user@tally.com",
            "organization_id":1,
            "external_id":"3z3PSit(9(7D9U",
            "external_access_token":"*kJT%bl^wPM&t",
            "created_at":"2019-02-05 16:45:32",
            "updated_at":"2019-02-05 16:45:32"
         }
      }
   ]
}

(GET) Organization tickets

URL: /organization/{organization}/api/tickets Description: Retrieve all tickets belonging to an organization Example:

/organization/tally/api/tickets

[
   {
      "id":1,
      "user_id":2,
      "assigned_to":null,
      "title":"Nu osde kam gasevug cu.",
      "status":"submitted",
      "created_at":"2019-02-05 16:45:33",
      "updated_at":"2019-02-05 16:45:33"
   },
   {
      "id":2,
      "user_id":2,
      "assigned_to":null,
      "title":"Ri gigpepreh akeavi muwege pirat.",
      "status":"submitted",
      "created_at":"2019-02-05 16:45:33",
      "updated_at":"2019-02-05 16:45:33"
   },
   {
      "id":3,
      "user_id":3,
      "assigned_to":null,
      "title":"Tiszu nevval ora lotbajcov afuzu.",
      "status":"replied",
      "created_at":"2019-02-05 16:45:33",
      "updated_at":"2019-02-05 16:45:33"
   },
   {
      "id":4,
      "user_id":2,
      "assigned_to":null,
      "title":"Eguira wupufu noc jege et.",
      "status":"replied",
      "created_at":"2019-02-05 16:45:33",
      "updated_at":"2019-02-05 16:45:33"
   }
]

(POST) User tickets

URL: /organization/{organization}/api/tickets Description: Creates a new ticket associated to a user and if the user posting the ticket does not have an account, creates an account for the user within the app

Headers:
{
     "user_id": [user_id],
     "title": [title],
     "body": [body],
     "token": [token]"
}
n2chao commented 5 years ago

I think we should close this issue and just keep the wiki

n2chao commented 5 years ago

Everything is in the wiki