Skip to content

rtm.php

Remote Ticket Management module for interacting with Jira tickets, including adding comments, searching tickets, and managing credentials.


rtm/add_comment

Adds a new comment to an existing ticket. Supports text messages and file attachments.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: add_comment
token ✅ string Authorization token for API access.
file ❌ array<string> Uploaded file for attachment to the comment.
ticket_id ✅ integer Unique identifier of the ticket to which the comment is added.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=add_comment" \
--data "token=HOSTKEY_TOKEN" \
--data "ticket_id=VALUE" \
--data "file[]=path/to/file1.txt" \
--data "file[]=path/to/file2.txt"
Success response example
{
"result": "OK",
"action": "add_comment",
"comment": {
"id": 12345,
"body": "This is a sample comment.",
"author": "You",
"created": 1704067200
}
}
Error examples
{
"code": -1,
"message": "Ticket id required"
}

rtm/create_credentials

Creates new Jira credentials for a user.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: create_credentials
token ✅ string Authorization token.
credentials_email ✅ string Email address for the Jira credentials.
credentials_name ✅ string Name or identifier for the Jira credentials.
credentials_password ✅ string Password for the Jira credentials.
email ✅ string The email address associated with the credentials.
jira_name ✅ string The username for Jira authentication.
jira_password ✅ string The password used for Jira authentication.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=create_credentials" \
--data "token=VALUE" \
--data "credentials_email=VALUE" \
--data "credentials_name=VALUE" \
--data "credentials_password=VALUE" \
--data "email=VALUE" \
--data "jira_name=VALUE" \
--data "jira_password=VALUE"
Success response example
{
"result": "OK",
"action": "create_credentials",
"pat": "7bc29eb23b1b879b21fce509597f07c"
}
Error examples
{
"code": -1,
"message": "Not enough actual parameters"
}

rtm/download_file

Downloads a specific file attachment from a ticket as a binary stream.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: download_file
token ✅ string Authorization token.
ticket_id ✅ string The unique identifier of the ticket for which to retrieve data.
file_hash ❌ string A specific hash used to identify and download a particular file attachment.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=download_file" \
--data "token=HOSTKEY_TOKEN" \
--data "ticket_id=VALUE" \
--data "file_hash=VALUE"
Success response example
{
"result": "OK",
"action": "download_file",
"data": "binary_content"
}
Error examples
{
"code": -1,
"message": "Ticket not found or you has no permissions"
}

rtm/download_image

Downloads an attachment from a ticket as a base64 encoded string.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: download_image
token ✅ string Authorization token.
ticket_id ✅ string Unique identifier of the ticket to retrieve data from.
file_hash ❌ string Specific hash used to identify and download a particular file attachment.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=download_image" \
--data "token=HOSTKEY_TOKEN" \
--data "ticket_id=VALUE" \
--data "file_hash=HASH_VALUE"
Success response example
{
"result": "OK",
"action": "download_image",
"data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/CchS7AAAAABJRU5ErkJggg=="
}
Error examples
{
"code": -1,
"message": "File not found"
}

rtm/get_ticket_by_id

Retrieves detailed information about a specific ticket, including its data and associated comments.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: get_ticket_by_id
token ✅ string Authorization token for API access.
ticket_id ✅ integer The unique identifier of the ticket to retrieve.
comments_from ❌ integer The starting index for comment pagination.
comments_limit ❌ integer Maximum number of comments to return in the response.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=get_ticket_by_id" \
--data "token=HOSTKEY_TOKEN" \
--data "ticket_id=VALUE"
Success response example
{
"result": "OK",
"action": "get_ticket_by_id",
"ticket": {
"issueId": 12345,
"issueKey": "RTM-101",
"createdDate": 1704067200,
"summary": "Issue with server connectivity",
"description": "<p>The server is not responding to pings.</p>",
"status": "open",
"statusDate": 1704070800
},
"comments": [
{
"id": 98765,
"body": "I have checked the logs and everything seems fine.",
"author": "John Doe",
"created": 1704074400
}
],
"total": 1,
"size": 1,
"start": 0,
"limit": 10,
"isLastPage": true
}
Error examples
{
"code": -1,
"message": "Ticket id required"
}

rtm/get_tickets

Returns a list of tickets with pagination support. Supports filtering by status and offset/limit.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: get_tickets
token ✅ string Authorization token for API access.
tickets_status ❌ string Filter tickets by their current status.
tickets_from ❌ integer The offset for pagination starting from which records to return.
tickets_limit ❌ integer The maximum number of tickets to return in one request.
requestStatus ❌ string The status of the ticket to filter by.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=get_tickets" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "get_tickets",
"tickets": [
{
"issueId": 1024,
"issueKey": "RTM-123",
"summary": "Server is down",
"status": "open",
"createdDate": "2024-05-20T10:00:00Z"
}
],
"total": 1,
"size": 1,
"start": 0,
"limit": 10,
"isLastPage": true
}
Error examples
{
"code": -1,
"message": "Error description from Jira API"
}

rtm/open_ticket

Creates a new support ticket in Jira with an optional diagnostic report and file attachment.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: open_ticket
token ✅ string Authorization token for API access.
summary ✅ string Summary of the support ticket.
message ✅ string Detailed description or message for the support ticket.
server_diagnostics_server_ids[] ❌ array<integer> List of server IDs to include in the diagnostic report.
file ❌ string Uploaded file for attachment to the ticket.
server_diagnostics_server_ids ❌ array<integer> List of server IDs used for generating diagnostics reports.
server_ids ❌ array<integer> List of server IDs used for generating diagnostics reports.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=open_ticket" \
--data "token=YOUR_TOKEN" \
--data "summary=Issue Summary" \
--data "message=Detailed description" \
--data "server_ids[]=101" \
--data "server_ids[]=102"
Success response example
{
"result": "OK",
"action": "open_ticket",
"ticket": {
"issueId": 12345,
"issueKey": "RTM-6789",
"createdDate": 1704067200,
"summary": "<p>Cannot access my server</p>",
"description": "The server is not responding to pings.",
"status": "open",
"statusDate": 1704067200
}
}
Error examples
{
"code": 400,
"message": "Emoji are not allowed in ticket summary or description"
}

rtm/search_term

Searches for tickets using a provided search term. Results are filtered based on user permissions and pagination settings.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: search_term
token ✅ string Authorization token for API access.
tickets_from ❌ integer The starting index for ticket pagination.
tickets_limit ❌ integer Maximum number of tickets to return in the search results.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=search_term" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "search_term",
"tickets": [
{
"issueId": 12345,
"issueKey": "RTM-101",
"summary": "Example ticket summary",
"status": "open",
"createdDate": "2024-01-15T10:30:00Z"
}
],
"total": 1,
"size": 1,
"start": 0,
"limit": 10,
"isLastPage": true
}
Error examples
{
"code": -1,
"message": "Search term not found"
}

rtm/search_ticket

Retrieves detailed information about a specific ticket using its identifier.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: search_ticket
token ✅ string Authorization token for API access.
ticket_id ✅ integer The unique identifier of the ticket to search for.

Request example

curl -s "https://invapi.hostkey.com/rtm.php" -X POST \
--data "action=search_ticket" \
--data "token=HOSTKEY_TOKEN" \
--data "ticket_id=VALUE"
Success response example
{
"result": "OK",
"action": "search_ticket",
"data": {
"issueId": 12345,
"issueKey": "RTM-101",
"createdDate": 1704067200,
"summary": "Issue with server connectivity",
"description": "<p>The server is not responding to pings.</p>",
"status": "open",
"statusDate": 1704070800
},
"ticket": null
}
Error examples
{
"code": -1,
"message": "Ticket number not defined"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×