Picnie REST API Documentation

Knowledgebase

πŸ’‘ Welcome to the Picnie API documentation! Here, you'll find everything you need to integrate, automate, and extend the capabilities of the Picnie platform. Whether you're a developer or a tech enthusiast, this guide will help you get started step by step.

Let’s unlock limitless potential together!


Getting Started

All API calls are sent in JSON format, and the responses are returned in JSON as well.

To begin, visit Picnie to create your API key. All API endpoints require this key for authentication.


API Endpoints


1. Create Project

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/create-project

Description:
This endpoint allows you to create a project on Picnie. Projects help in managing assets effectively.

Request:

{
  "name": "Project with API"
}

Parameters:

  • name

    (Required): Name of the project.

Response Example:

{
  "error": false,
  "message": "Success",
  "data": {
    "id": "32",
    "name": "Project with API"
  }
}


2. Get My Projects

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/get-my-projects

Description:
Retrieve a list of all your Picnie projects.

Response Example:

{
  "error": false,
  "message": "Success",
  "data": [
    {
      "id": "21",
      "name": "Test Project"
    },
    {
      "id": "32",
      "name": "Project with API"
    }
  ]
}


3. Get Template

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/get-template

Description:
Fetch the contents of a template by providing the

template_id

.

Request:

{
  "template_id": "2075"
}

Response Example:

{
  "error": false,
  "message": "Success",
  "complete_object": {
    "name": "Simple Template",
    "type": "Image",
    "details": [
      {
        "name": "background_image",
        "image_url": "https://example.com/image.png"
      }
    ]
  }
}


4. Create Image

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/create-image

Description:
Generate a single image by customizing template JSON objects.

Request:

{
  "project_id": "1",
  "template_id": 2020,
  "template_name": "Daily Motivation",
  "type": "image",
  "output_image_quality": "High",
  "output_image_format": "png",
  "details": [
    {
      "name": "background_image",
      "image_url": "https://example.com/image.png"
    },
    {
      "name": "Title_0",
      "text": "One step at a time"
    }
  ]
}

Response Example:

{
  "error": false,
  "message": "Success",
  "url": "https://example.com/generated_image.png"
}


5. Add Watermark

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/add-watermark-image

Description:
Add a watermark to an image.

Request:

{
  "project_id": 1,
  "background_image_url": "https://example.com/background.jpg",
  "front_image_url": "https://example.com/logo.png",
  "position": "br",
  "image_max_width": "800",
  "image_max_height": "800"
}

Response Example:

{
  "error": false,
  "message": "Success",
  "url": "https://example.com/watermarked_image.jpg"
}


6. Resize Image

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/resize-image

Description:
Resize an image by providing height, width, or percentage.

Request:

{
  "project_id": 1,
  "image_url": "https://example.com/image.jpg",
  "resize_type": "1",
  "height": "500",
  "width": "800",
  "resize_percentage": "50",
  "no_enlarge_on_smaller": "1"
}

Response Example:

{
  "error": false,
  "message": "Success",
  "url": "https://example.com/resized_image.jpg"
}


7. Compress Image

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/compress-image

Description:
Compress images without quality loss.

Request:

{
  "project_id": 1,
  "image_url": "https://example.com/image.jpg",
  "image_quality": "65",
  "image_output_format": "original"
}

Response Example:

{
  "error": false,
  "message": "Success",
  "url": "https://example.com/compressed_image.jpg"
}


8. Crop Image

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/crop-image

Description:
Crop an image to specific dimensions.

Request:

{
  "project_id": 8,
  "image_url": "https://example.com/image.jpg",
  "height": "720",
  "width": "1080"
}

Response Example:

{
  "error": false,
  "message": "Success",
  "url": "https://example.com/cropped_image.jpg"
}


9. Apply Filters to Image

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/filter-on-image

Description:
Apply filters like grayscale, emboss, and more to an image.

Supported Filters:

  • IMG_FILTER_NEGATE

  • IMG_FILTER_GRAYSCALE

  • IMG_FILTER_EDGEDETECT

  • IMG_FILTER_EMBOSS

  • IMG_FILTER_GAUSSIAN_BLUR

  • IMG_FILTER_SELECTIVE_BLUR

  • IMG_FILTER_MEAN_REMOVAL

Request:

{
  "project_id": 8,
  "image_url": "https://example.com/image.jpg",
  "filter": "IMG_FILTER_GRAYSCALE"
}

Response Example:

{
  "error": false,
  "message": "Success",
  "url": "https://example.com/filtered_image.jpg"
}


10. Convert Image Format

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/convert-image

Description:
Convert an image from one format to another, such as PNG to JPG.

Request:

{
  "project_id": 8,
  "image_url": "https://example.com/image.jpg",
  "output_format": "webp"
}

Response Example:

{
  "error": false,
  "message": "Success",
  "url": "https://example.com/converted_image.webp"
}


11. Create PDF

  1. Method:

    POST

  2. Authorization: Include the API Key in the

    Authorization

    header.
  3. Endpoint:

    https://picnie.com/api/v1/create-pdf

Description:
Generate a PDF document from a template.

Request:

{
  "project_id": "25",
  "template_id": 2020,
  "template_name": "Daily Motivation",
  "type": "pdf",
  "details": [
    {
      "name": "background_image",
      "image_url": "https://example.com/image.png"
    },
    {
      "name": "Title_0",
      "text": "@reallygreatsite"
    },
    {
      "name": "Title_1",
      "text": "One step at a time, you'll get there"
    }
  ]
}

Response Example:

{
  "error": false,
  "message": "Success",
  "url": "https://example.com/generated_pdf.pdf"
}


These endpoints empower developers to enhance their workflows with Picnie's rich API functionalities. For more, visit the Picnie Dashboard.

Teampicnie

1 year ago