Create Article Asset

  • REST Method: POST
  • URL: https://docsapi.helpscout.net/v1/assets/article
  • Content-Type: multipart/form-data

Use this endpoint to upload files for use in articles (either inline images or attached files). Note that the content-type is multipart/form-data. A link to the file will be returned in the response. If the file being uploaded is an image, the final image dimensions will also be returned in the response.

An example curl request to upload a file:
curl -v -u API_KEY:X 
-F key=API_KEY 
-F articleId=ARTICLE_ID 
-F assetType=image 
-F file=@FILE.jpg https://docsapi.helpscout.net/v1/assets/article

Request

Name Type Required Default Notes
key String Y   An API key used to authenticate this request.
articleId String Y   The id of the article the asset will be associated with.
assetType String Y   The type of asset being uploaded.
  • 'image': an inline image displayed in the text of the article.
  • 'attachment': a file, such as a Word document or PDF that cannot be displayed in the text of the article but can be displayed as a link.
fileName String N   The file name will default to the name of the file being uploaded but can be overridden using this attribute.

Response

Response Name Type Notes
Header Status Integer 201
{
    "filelink": "https://helpscout.net.s3.amazonaws.com/docs/assets/520459e99af8049acc16b168/images/5238f3533004d407166463c1/photo.jpg",
    "filename": "my-file.jpg",
    "width": 300,
    "height": 100
}