Issue Attachments

GET /issues/{id}/files #

Get issue files

Parameters

Name In Type Description
id required path integer The issue ID e.g. 123
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.

Responses

  • 200 Issue files returned successfully. X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
    files object[] required
    id integer
    reporter object
    name string
    email string
    created_at string · date-time
    filename string
    size integer
    content_type string
    content string · byte Base64-encoded file content.
    {
        "files": [
            {
                "id": 1,
                "reporter": {
                    "name": "John Doe",
                    "email": "john@example.com"
                },
                "created_at": "string",
                "filename": "string",
                "size": 1,
                "content_type": "string",
                "content": "string"
            }
        ]
    }
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X GET \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123/files
POST /issues/{id}/files #

Add attachments to issue

Parameters

Name In Type Description
id required path integer The issue ID e.g. 123
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.

Request body required

files object[]
name string
content string
reporter object
name string

Responses

  • 201 Resource created successfully with no response body X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X POST \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  -H "Content-Type: application/json" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123/files \
  -d '{
    "files": [
        {
            "name": "string",
            "content": "string"
        }
    ],
    "reporter": {
        "name": "string"
    }
}'
Request body · application/json
{
    "files": [
        {
            "name": "string",
            "content": "string"
        }
    ],
    "reporter": {
        "name": "string"
    }
}
GET /issues/{id}/files/{file_id} #

Get file from issue

Parameters

Name In Type Description
id required path integer The issue ID e.g. 123
file_id required path integer e.g. 567
X-Mantis-Username header string Username to impersonate for this request. Requires an authorized API token.

Responses

  • 200 File returned successfully. X-Mantis-Username X-Mantis-LoginMethod X-Mantis-Version
    files object[] required
    id integer
    reporter object
    name string
    email string
    created_at string · date-time
    filename string
    size integer
    content_type string
    content string · byte Base64-encoded file content.
    {
        "files": [
            {
                "id": 1,
                "reporter": {
                    "name": "John Doe",
                    "email": "john@example.com"
                },
                "created_at": "string",
                "filename": "string",
                "size": 1,
                "content_type": "string",
                "content": "string"
            }
        ]
    }
  • 400 Bad Request
  • 401 Authentication is required or the supplied API token is invalid. WWW-Authenticate
  • 403 The authenticated user is not authorized for this operation, impersonation, or API access level.
  • 404 Entity not found
  • 503 MantisHub is temporarily unavailable and cannot process API requests.
cURL
curl -X GET \
  -H "Authorization: Bearer $MANTIS_TOKEN" \
  https://yourmantishubname.mantishub.io/api/rest/issues/123/files/567