...
Generate an API Token:
Log in to your Jira Cloud account.
Navigate to Account Settings.
Select Security.
Click on Create and manage API tokens.
Generate a new API token and store it securely.
Prepare Your Credentials:
Combine your email address and API token in the format:
Code Block user@example.com:your_api_token
Encode Credentials in Base64:
Use a Base64 encoder to encode the combined string.
For example, in Python:
Code Block import base64 credentials = 'user@example.com:your_api_token' encoded_credentials = base64.b64encode(credentials.encode('utf-8')).decode('utf-8')
Include in HTTP Authorization Header:
Add the following header to your API requests:
Code Block Authorization: Basic encoded_credentials Domain: https://<your-domain>.atlassian.net
Example
...
If your email is user@example.com
and your API token is abcd1234
, your combined string is:
...
Code Block |
---|
Authorization: Basic dXNlckBleGFtcGxlLmNvbTphYmNkMTIzNA==
Domain: https://your-url.atlassian.net |
Using the AssetType REST Endpoint
...
Code Block |
---|
GET https://checkout.mumosystems.com/rest/checkout/1.0/assettype |
Parameters:
This endpoint does not require any query requires projectId parameters for a basic GET request.
Example Request Using cURL:
Code Block |
---|
curl -X GET \ 'https://checkout.mumosystems.com/rest/checkout/1.0/assettype?projectId=10001' \ -H 'Authorization: Basic dXNlckBleGFtcGxlLmNvbTphYmNkMTIzNA==' \ -H 'Domain: https://<your-domain>.atlassian.net/' \ -H 'Content-Type: application/json' |
Expand | ||
---|---|---|
|
...
|
The response is a JSON array of asset type objects, each containing:
id
: The unique identifier of the asset type.name
: The name of the asset type.description
: A brief description of the asset type.
Example Request Using Python and Requests Library:
Code Block | ||
---|---|---|
| ||
import requests import base64 # Your credentials email = 'user@example.com' api_token = 'your_api_token' credentials = f'{email}:{api_token}' encoded_credentials = base64.b64encode(credentials.encode('utf-8')).decode('utf-8') # Headers headers = { 'Authorization': f'Basic {encoded_credentials}', 'Content-Type': 'application/json' } # API URL url = 'https://your-domain.atlassian.net/rest/checkout/1.0/assettype' # Send GET request response = requests.get(url, headers=headers) # Check response if response.status_code == 200: asset_types = response.json() print(asset_types) else: print(f'Error: {response.status_code} - {response.text}')
|
...