Add an Image

POST https://restapi.actonsoftware.com/api/1/image

This endpoint allows you to add an image to the account.

Parameters

Name Parameter
Type
Allow
Multiple
Required/
Optional
Data Type Description
Authorization: Header False Required String Insert your generated access token.
("Bearer {access token}")
name Form False Optional String Specify a name for the image.
file Form False Required File Attach the image file.
foldername Form False Optional String Specify the folder name you would like the image added.

Response

{
  "status": "success",
  "message": "The file has been uploaded",
  "id": "f-07c4cdc0-56ee-468e-8347-542a3fd381c1"
}

 

Code Examples

curl -X POST https://restapi.actonsoftware.com/api/1/image -H 'Authorization: Bearer 12345678-9abc-defg-hijk-lmnopqrs' -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' -F file=@/Users/john.doe/Downloads/logo.png -F name=test2
// This code requires the following modules
// "fs" (npm install fs)
// "request" (npm install request)

var fs = require("fs");
var request = require("request");

options = {
    method: "POST",
    url: "https://restapi.actonsoftware.com/api/1/image",

    headers: {
        "Authorization": "Bearer 12345678-9abc-defg-hijk-lmnopqrs",
        "Content-Type": "multipart/form-data"
    },
    formData : { name: 'test8',
     file: 
      { value: fs.createReadStream("/Users/john.doe/Downloads/test.png"),
        options: 
         { filename: '/Users/john.doe/Downloads/test.png'} } } };

request.post(options, function (err, res, body) {
    if(err) console.log(err);
    console.log(body);
});