Skip to main content

Making requests

Every call to Jira or Confluence through API Key Manager is a single HTTP POST to the app's Endpoint URL.

The Endpoint URL​

The URL is shown at the top of the app's main page. It is the same for all keys of one installation. A request is only honoured with a valid key, but it is still good practice to keep the URL out of public repositories and web pages.

The HTTP request​

PartValue
MethodPOST
URLYour Endpoint URL
Header apikeyYour API key
Header Content-Typeapplication/json (recommended)
BodyThe JSON envelope below

The envelope​

The body describes the request you want the app to make to Jira or Confluence:

{
"options": {
"method": "GET",
"headers": {
"Content-Type": "application/json",
"Accept": "application/json"
},
"body": { }
},
"url": "/rest/api/3/issue/DEV-78"
}
FieldRequiredDescription
urlyesThe API path, starting with /, including a query string if you need one. Not a full URL: the request always goes to your own site. Jira paths start with /rest/, Confluence paths with /wiki/.
options.methodyesThe HTTP method to use: GET, POST, PUT, DELETE, … in upper case. Must be allowed by the key.
options.headersnoHeaders for the request to Atlassian, typically Content-Type and Accept.
options.bodynoThe request body for Atlassian, as a JSON object (not as a string).

The apikey header belongs to the outer request, not into options.headers.

Examples​

Read an issue (Jira)​

{
"options": { "method": "GET", "headers": { "Accept": "application/json" } },
"url": "/rest/api/3/issue/DEV-78"
}

Create an issue (Jira)​

{
"options": {
"method": "POST",
"headers": { "Content-Type": "application/json", "Accept": "application/json" },
"body": {
"fields": {
"project": { "id": "10005" },
"summary": "Created through API Key Manager",
"issuetype": { "id": "10017" }
}
}
},
"url": "/rest/api/2/issue"
}

Read a page (Confluence)​

{
"options": { "method": "GET", "headers": { "Accept": "application/json" } },
"url": "/wiki/rest/api/content/12345?expand=body.storage"
}

Search with a query string​

Put the query string into url. Encode special characters as you would in any URL.

{
"options": { "method": "GET", "headers": { "Accept": "application/json" } },
"url": "/rest/api/3/search/jql?jql=project%20%3D%20DEV&fields=summary,status"
}

Ready-made versions of these in many languages are in the samples.

What the app checks before forwarding​

  1. The request has an apikey header and a valid JSON body.
  2. The key exists and has not expired.
  3. options.method is allowed for the key, and url is allowed by its endpoints.
  4. For Create Issue and Stored JQL keys, the key's additional rules (Jira only).

If a check fails, the request is not forwarded. See Errors.