Giter VIP home page Giter VIP logo

printer's Introduction

Carris Metropolitana Printer

In progress...


Base URL: https://printer.carrismetropolitana.pt/[endpoint]


POST /publish

Publish a new job to the print queue.

Example Request:

{

    // required fields
    render_host: "escolas.carrismetropolitana.pt",
    render_path: "803239/render",


    // optional fields
    render_format: 'A4',
    owner_lang: "pt",
    owner_name: "Name of the User",
    owner_email: "[email protected]",
    gdpr_consent: true,
    filename: "Name of the downloaded file"

}

Example Response:

{

    acknowledged: true,
    insertedId: "job_id"

}

POST /update/:id

Append additional owner info to a waiting job.

Example Request:

{

    owner_lang: "pt",
    owner_name: "André",
    owner_email: "[email protected]",
    gdpr_consent: true

}

Example Response:

{

    _id: "654acdcf816f9f9ba9ecd23a",

    status: "downloaded",

    date_registered: "2023-11-01T00:00:00.000Z",
    date_processing: "2023-11-01T00:00:00.000Z",
    date_ready: "2023-11-01T00:00:00.000Z",
    date_notified: ["2023-11-01T00:00:00.000Z"],
    date_downloaded: ["2023-11-01T00:00:00.000Z"],
    date_expired: null,

    owner_lang: "pt",

    render_host: "escolas.carrismetropolitana.pt",
    render_path: "803239/render",
    render_format: "A4",

    filename: "Name of the downloaded file"

}

GET /status/:id

Returns the current status of the requested job.

Example Response:

{

    _id: "654acdcf816f9f9ba9ecd23a",

    status: "ready",

    date_registered: "2023-11-01T00:00:00.000Z",
    date_processing: "2023-11-01T00:00:00.000Z",
    date_ready: "2023-11-01T00:00:00.000Z",
    date_notified: ["2023-11-01T00:00:00.000Z"],
    date_downloaded: ["2023-11-01T00:00:00.000Z"],
    date_expired: null,

    owner_lang: "pt",

    render_host: "escolas.carrismetropolitana.pt",
    render_path: "803239/render",
    render_format: "A4",

    filename: "Name of the downloaded file"

}

GET /download/:id

Downloads the rendered PDF file for the requested job.

Other useful info

Job Status

A job can have the following statuses:

status description
registered Job is waiting to be processed.
paused Job was manually paused.
processing Job is being rendered right now.
ready Job has finished rendering and is available for download.
error Job has encountered an error.
downloaded Job has been downloaded at least once.
expired Job is expired and download is no longer possible.

Contributing

If you'd like to contribute new features or help fix any errors, please fork this repository and submit a pull request. We welcome contributions of all kinds, including bug fixes, documentation improvements, and new features.

printer's People

Contributors

joao-vasconcelos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.