OSTicket Unofficial API

Overview



Welcome to the unofficial OSTicket API!

The purpose of this API is to help the community and leverage the use of OSTicket.
For more info, please go to their official website: https://osticket.com/

Tested Versions

This api was tested in the following OST versions:

Version
v1.15.3.1 Latest Release
v1.14.3

How to Use

To use OSTicket Unofficial API you have to place the ost_wbs directory in the root of OSTicket server.
Then, go to ost_wbs > config.php and change the DB credentials and the table prefix.

Use the following URL:

{YOUR-DOMAIN}/ost_wbs/?

NOTE: If you dont know the credentials, go to /include/ost-config.php. That is the main config file for OSTicket system.

Authentication

In all requests, the API key that was created in the OSTicket system must be sent to authenticate the user.

Option Type Mandatory Description
apikey string βœ… Official API-Key generated in OSTicket System

Example:

{YOUR-DOMAIN}/ost_wbs/?apikey={API-KEY}

🟩 Ticket Info

πŸ”· Specific Ticket

You can fetch all info from a specific ticket using the ID or ID Number, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=ticket&condition=specific&parameters={TICKET-ID/TICKET-NUMBER}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string ticket βœ… Indicates the content of the request
condition string specific βœ… Indicates the condition of the request
parameters int or string ID or Number βœ… Indicates specific ID or Number

πŸ”· By Status

You can fetch all tickets based on the current status, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=ticket&condition=all&sort=status&parameters={TICKET-STATUS-ID}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string ticket βœ… Indicates the content of the request
condition string all βœ… Indicates the condition of the request
sort string status βœ… Indicates the type of search
parameters int or string Ticket Status ID βœ… Ticket status ID you want to search for

Available ticket status:

Option Name
0 All not necessarily a "state" but returns all tickets in the DB regardless of state
1 Open
2 Resolved
3 Closed
4 Archived
5 Deleted
6 On Going
7 Pending

πŸ”· Between Dates

You can fetch all tickets by creation between two given dates, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=ticket&condition=all&sort=creationDate&parameters={START-DATEtoEND-DATE}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string ticket βœ… Indicates the content of the request
condition string all βœ… Indicates the condition of the request
sort string creationDate βœ… Indicates the type of search
parameters string 1990-01-01to2000-01-01 βœ… Date interval that all tickets will be fetched

πŸ”· Between Dates by Status

You can fetch all tickets by creation between two given dates and by status, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=ticket&condition=all&sort=statusByDate&parameters={START-DATEtoEND-DATE},{TICKET-STATUS-ID}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string ticket βœ… Indicates the content of the request
condition string all βœ… Indicates the condition of the request
sort string statusByDate βœ… Indicates the type of search
parameters string 1990-01-01to2000-01-01,2 βœ… Date interval and status by wich all tickets will be fetched

🟩 User Info

?? Specific User

You can fetch all info from a specific user using the ID, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=user&condition=specific&parameters={USER-ID}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string user βœ… Indicates the content of the request
condition string specific βœ… Indicates the condition of the request
parameters int User ID βœ… Indicates specific ID

πŸ”· Between Dates

You can fetch all user by creation between two given dates, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=user&condition=all&sort=creationDate&parameters={START-DATEtoEND-DATE}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string user βœ… Indicates the content of the request
condition string all βœ… Indicates the condition of the request
sort string creationDate βœ… Indicates the type of search
parameters string 1990-01-01to2000-01-01 βœ… Date interval that all users will be fetched

🟩 Department Info

πŸ”· Specific Department

You can fetch all info from a specific deparment using the ID, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=department&condition=specific&parameters={DEPARTMENT-ID}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string department βœ… Indicates the content of the request
condition string specific βœ… Indicates the condition of the request
parameters int Department ID βœ… Indicates specific ID

πŸ”· Between Dates

You can fetch all departments by creation between two given dates, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=department&condition=all&sort=creationDate&parameters={START-DATEtoEND-DATE}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string department βœ… Indicates the content of the request
condition string all βœ… Indicates the condition of the request
sort string creationDate βœ… Indicates the type of search
parameters string 1990-01-01to2000-01-01 βœ… Date interval that all departments will be fetched

🟩 SLA Info

πŸ”· Specific SLA

You can fetch all info from a specific sla using the ID, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=sla&condition=specific&parameters={SLA-ID}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string sla βœ… Indicates the content of the request
condition string specific βœ… Indicates the condition of the request
parameters int SLA ID βœ… Indicates specific ID

πŸ”· Between Dates

You can fetch all departments by creation between two given dates, for example:

{YOUR DOMAIN}/ost_wbs/?apikey={API-KEY}&query=sla&condition=all&sort=creationDate&parameters={START-DATEtoEND-DATE}
Option Type value Mandatory Description
apikey string API-Key βœ… Official API-Key generated in OSTicket System
query string sla βœ… Indicates the content of the request
condition string all βœ… Indicates the condition of the request
sort string creationDate βœ… Indicates the type of search
parameters string 1990-01-01to2000-01-01 βœ… Date interval that all SLAs will be fetched
Comments
  • Always get

    Always get "Incorrect API format" as response

    I'm trying to use this project on my osTicket installation, but i'm struggling to make it work.

    I want to fetch data with a script written in R, using the jsonlite and httr libraries, but i'm not sure what's going wrong that keeps returning this:

    "{\"status\":\"Error\",\"data\":\"Incorrect API Format\"}"

    Here's my code:

    library(jsonlite)
    library(httr)
    
    header_api <- c('apikey' = 'my_api_key')
    
    call <- VERB(verb = "GET", 
                    url = "https://url_to_my_osticket_root/upload/ost_wbs/", 
                    config = add_headers(header_api), 
                    body = '{
                            "query":"ticket",
                            "condition":"all",
                            "sort": "status",
                            "parameters":{
                                "status":0
                                }
                            }')
    
    convert_rawdata <- content(call, "text")
    
    

    Am I missing something? What "Incorrect API format" means? I'm passing the API key in the header as a string, following the documentation instructions.

    I will be happy if someone helps me on this. Thanks!

    opened by ex0ticOne 6
  • Can't view query on specific ticket but can view ticket by status

    Can't view query on specific ticket but can view ticket by status

    I trying ost_wbs on the root osticket installation and configire config for database and premises table but i trying access query for detial specific ticket by ID/Ticket number not work.

    My osticket trying version V latest version fail V.15.4.4 fail V.15.3.1 fail

    So you can help me please...?

    opened by F4izal 2
  • Why so many mandatory fields ?

    Why so many mandatory fields ?

    If i want to open a ticket, why so many mandatory fields ?

    Can many of them be optional ?

    for example , we dont use sla_id or priority_id , can it be for example =1 by default if its not in api ?

    opened by altomarketing 1
  • Added New Features

    Added New Features

    This is a great API and it's easy to add additional features. I wanted to have a way to include FAQ's from the knowledgebase and use the help topics in a contact form on my website.

    I've also included an autoloader for the class files to make adding additional features quicker and a fix in the OSTicketAPI class that prevents errors when the sort and parameter attributes aren't used.

    This also includes the variable name fix for class.ticket.php

    opened by Nexis81 0
  • staff_id always returning

    staff_id always returning "0" in json to fetch all tickets.

    API is excellent and easy to use. Many thanks for your great work

    Issue Description: staff_id always returns "0" in json to fetch all tickets. Sample response: https://jsoneditoronline.org/#left=cloud.ee63bb970ff447899dc5725ccb1bf943 image

    Please check. Thank You

    opened by ktrajasekar 0
  • Added GET tickets by last updated date

    Added GET tickets by last updated date

    Thank you for this excellent API! It's a great addition to osTicket and I appreciate your hard work on it.

    I wanted to use an API to find all tickets that were last modified between two dates.

    It is the same as getting tickets by creation date, but this uses when the ticket was last updated/modified.

    The database column to sort by is lastupdate, instead of created.

    opened by reidsunderland 0
  • Error 404 on API request

    Error 404 on API request

    ost api

    ost api 2

    Hi, I am using osticket version v1.16.2, php 8.0 and mysql 5.5.

    I had made the changes as per your provided installation details.

    I am getting error 404 on POST ADD api request and don't understand what might be the issue. But I am sure that its not related to api key as I am able to create tickets using the other url and different body parameters but the same api key(please see the screenshot 1 and 2) but I want to use other api features such as close, edit etc.

    opened by xarim96 5
  • Params and users

    Params and users

    Hello! This API that you've made is great. The code is awesome. I'm not sure if these changes will be useful for you or others, but figured I'd let you take a look. Also, I'm not sure I've followed your style sufficiently, apologies for the hacks.

    In general - I was wanting a couple things: first, to be able to add tickets from our CRM, and add a user if needed. So with these mods, we can first check if the user existed in OST, and if they didn't, add them automatically.

    Second, the tickets from this API were not using the 'status' field in some views, and the title was displaying differently from manually created tickets. I added some insert queries to add form table data, where it seems those are stored? The result looks more 'complete' in my environment when reviewing tickets.

    Finally, we wanted a way to add internal notes when a ticket is created from our CRM. It's a useful way to get agents up to speed, without having that info viewable. So, I added this via some new "optionalParameters" hacking...

    Most other things were minor. Apologies for the 'spacing' changes, it seems my VIM does that automatically...

    Thanks again for this project and all the best!

    opened by halcyonyarn 1
  • fixed ticket query joining thread wrong

    fixed ticket query joining thread wrong

    Queries in class.ticket.php were trying to join table thread_entry directly onto table ticket and was pulling inaccurate data. Needs to be joined onto the thread table first.

    opened by lawsim 1
Releases(ostapi-v2.0.5)
  • ostapi-v2.0.5(Aug 11, 2022)

    v2.0.5

    Updated User Class:

    • search by email
    • updated "search by id" function with new body request parameters
    • updated "add" function with new body request parameters
    • returns user ID when a new user is added

    Updated Ticket Class:

    • returns ticket ID when a new ticket is added

    Fixed case sensitive headers from different hosts (#10) Fixed bugs Improved Overall Code Updated Documentation

    Source code(tar.gz)
    Source code(zip)
  • ostapi-v2.0.4(Jul 18, 2022)

  • ostapi-v2.0.3(Jun 27, 2022)

  • ostapi-v2.0.2(Jun 23, 2022)

    v2.0.2

    Improved Overall Security Added "Reply Ticket" Added "Close Ticket" (Change state of a ticket) Improved Overall Code New API Documentation

    Source code(tar.gz)
    Source code(zip)
  • ostapi-v2.0.1(Jun 22, 2022)

  • ostapi-v2.0.0(Jun 20, 2022)

    v2.0.0

    Changed API overall structure (1.0.0 requests no longer work) Improved security Fixed multiple bugs Added new functionalities Improved documentation

    Source code(tar.gz)
    Source code(zip)
  • ostapi-v1.0.7(Jun 17, 2022)

  • ostapi-v1.0.0(Aug 28, 2021)

Owner
Bruno Vieira
β€œMake it work, make it right, make it fast.” – Kent Beck
Bruno Vieira
Universal payments API SDK (UNOFFICIAL QIWI CLIENT)

Qiwi Php Client Especially for ?? Zorra Telecom and ?? Everyone else ΠŸΡ€ΠΈΠ²Π΅Ρ‚ Attention: At the moment the number of methods is very limited, they will

Ivan Terentev 2 Oct 25, 2022
DigitalOcean API v2 client for Symfony and API Platform

DigitalOcean Bundle for Symfony and API Platform DunglasDigitalOceanBundle allows using the DigitalOcean API from your Symfony and API Platform projec

KΓ©vin Dunglas 25 Jul 27, 2022
This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

Daniel Henze 3 Aug 29, 2022
API SDK for OpenTrade Commerce API: Taobao, Alibaba, JD, 1688, Aliexpress, Ebay.

OtapiPhpClient Create Client $client = new OtClient($key, $secret, $lang); key (Access Key) secret (Secret for access key) language (2 symbol lang id

OpenTrade Commerce 5 Sep 20, 2022
Fanmade project using Twitter API and Marvel API.

Project Marvel Memories A fanmade project in PHP using API Twitter V2, Marvel API and Github action scheduler. What about? Posts a random cover with d

Julien SCHMITT 15 Dec 17, 2022
Nexmo REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Client Library for PHP Support Notice This library and it's associated packages, nexmo/client and nexmo/client-core have transitioned into a "Maintena

Nexmo 75 Sep 23, 2022
API client for ThePay - payment gate API

This is the official highly compatible public package of The Pay SDK which interacts with The Pay's REST API. To get started see examples below.

ThePay.cz s.r.o. 3 Oct 27, 2022
Code Quiz MonoRepo (API, API Client, App)

Code Quiz Welcome to the Code Quiz Open Source project from How To Code Well. This is an Open Source project that includes an API and an App for the d

How To Code Well 2 Nov 20, 2022
OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

Mounir R'Quiba 6 Jun 14, 2023
PHP library for the Stripe API.

Stripe PHP bindings The Stripe PHP library provides convenient access to the Stripe API from applications written in the PHP language. It includes a p

Stripe 3.3k Jan 5, 2023
A simple PHP GitHub API client, Object Oriented, tested and documented.

PHP GitHub API A simple Object Oriented wrapper for GitHub API, written with PHP. Uses GitHub API v3 & supports GitHub API v4. The object API (v3) is

KNP Labs 2k Jan 7, 2023
A PHP library for communicating with the Twilio REST API and generating TwiML.

twilio-php The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio API c

Twilio 1.4k Jan 2, 2023
A PHP library for the Campaign Monitor API

createsend A PHP library which implements the complete functionality of the Campaign Monitor API. Installation Composer If you use Composer, you can r

Campaign Monitor 287 Jan 6, 2023
PHP 5.3+ library which helps you to interact with the DigitalOcean API

DigitalOcean The version 2 of the API will be available soon ! Please visit DigitalOceanV2 and contribute :) This PHP 5.3+ library helps you to intera

Antoine Kirk 156 Jul 30, 2022
PHP library for the GitHub API v3

GitHub API v3 - PHP Library Currently under construction. Overview Provides access to GitHub API v3 via an Object Oriented PHP library. The goal of th

Darren Rees 62 Jul 28, 2022
Twitter REST API for PHP 5.3+

README The Wid'op Twitter REST library is a modern PHP 5.3+ API allowing you to easily interact with Twitter 1.1. In order to sign your request with t

Wid'op 24 Aug 10, 2020
A DigitalOcean API bridge for Laravel

Laravel DigitalOcean Laravel DigitalOcean was created by, and is maintained by Graham Campbell, and is a DigitalOcean PHP API Client bridge for Larave

Graham Campbell 421 Dec 20, 2022
A GitHub API bridge for Laravel

Laravel GitHub Laravel GitHub was created by, and is maintained by Graham Campbell, and is a PHP GitHub API bridge for Laravel. It utilises my Laravel

Graham Campbell 547 Dec 30, 2022
PHP library to use IOTA REST API to help node management and tangle queries

iota.php About PHP library to use IOTA REST API to help node management and tangle queries. Please be aware that this library is in an early developme

IOTA Community 45 Dec 13, 2022