--- title: Attachment API description: tags: developer portal --- {%hackmd bXqUSiOGTLuFjPgSJ74wxQ %} # Attachments API [toc] ## Upload an image to a note coming soon <!-- ## Upload a image to a note - `POST https://hackmd.io/uploadimage?noteId=:noteId` - Query params - noteId: string, required - Form Data - image: File - Success Response - code: `200` - body: ```json {"data":{"link":"https://hackmd.io/_uploads/By9HvYLR6.png"}} ``` --> ## Download an attachment - `GET https://hackmd.io/_uploads/:filename` - Url params: - filename: string - Authorization: - [Use the authorization header](https://hackmd.io/@hackmd-api/developer-portal/https%3A%2F%2Fhackmd.io%2F%40hackmd-api%2Fapi-authorization) - Success Response - Trigger the download - Sample usage ```bash # -L option turn on the follow redirection curl -H "Authorization: Bearer TOKEN" https://hackmd.io/_uploads/By9HvYLR6.png -L > output.png ``` :::info :bulb: Note - Turn on the "follow redirection" option in your REST client. - You have to **use the `hackmd.io` domain** instead of the `api.hackmd.io` domain in regular APIs. :::
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.