Skip to the page

Add image

Copies the image at an address and answers with where the copy is served. Emails then link the copy in place of that address. The same address twice answers with the copy that is there, and an image that failed is tried again.

opensend.images.add(input)
Needs the scopeimages:writeFrom a terminalopensend images add

Input

  • urlstringRequired

    The public https:// address of the image: a PNG, JPEG, GIF or WebP file of 5 MB at most. Up to 2,048 characters.

Returns

The call resolves to the answer, already parsed. A call the API refuses throws OpenSendError with the code and the message of the answer. SDK lists the errors of the client itself.

  • object"image"

    Always image.

  • idstring

    The id of the image.

  • urlstring | null

    The address the image is served at. Emails link it in place of source when the image was copied, and it is the address to write in an email when the image was uploaded. null until the image is ready.

  • sourcestring

    Where the image came from: the address it was copied from, as it is written in your emails, or the name of the file that was uploaded.

  • originstring

    How the image got here: address when it was copied from an address, upload when it was sent as a file.

    One ofaddressupload

  • statusstring

    pending while it waits to be copied, ready once it is served, failed when it could not be copied. An uploaded image is ready at once.

    One ofpendingreadyfailed

  • typestring | null

    The media type of the image: image/png, image/jpeg, image/gif or image/webp. null until it is ready.

    One ofimage/pngimage/jpegimage/gifimage/webp

  • sizeinteger | null

    The size of the image in bytes, or null until it is ready.

  • reasonstring | null

    Why the last try to copy it did not work, in words, or null.

  • createdAtstring

    When the image was first seen.

  • updatedAtstring

    When it was last copied or tried.