Note: To access the Content Attachments API during the preview period, you must provide a custom media type in the Accept header:
application/vnd.github.corsair-preview+json
Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support or GitHub Premium Support.
Creates an attachment under a content reference URL in the body or comment of an issue or pull request. Use the id of the content reference from the content_reference event to create an attachment.
The app must create a content attachment within six hours of the content reference URL being posted. See "Using content attachments" for details about content attachments.
You must use an installation access token to access this endpoint.
POST /content_references/:content_reference_id/attachments
| Name | Type | Description |
|---|---|---|
title |
string |
Required. The title of the content attachment displayed in the body or comment of an issue or pull request. |
body |
string |
Required. The body text of the content attachment displayed in the body or comment of an issue or pull request. This parameter supports markdown. |
This example creates a content attachment for the domain https://errors.ai/.
{
"title": "[A-1234] Error found in core/models.py file",
"body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\nself.save()"
}
Status: 200 OK
{
"id": 101,
"title": "[A-1234] Error found in core/models.py file'",
"body": "You have used an email that already exists for the user_email_uniq field.\n ## DETAILS:\n\nThe (email)=(Octocat@github.com) already exists.\n\n The error was found in core/models.py in get_or_create_user at line 62.\n\n self.save()"
}