The Apprise API

Apprise allows you to send a notification to almost all of the most popular notification services available to us today such as: Telegram, Discord, Slack, Amazon SNS, Gotify, etc. This API provides a simple gateway to directly access it via an HTTP interface.

  • chevron_rightThis project was designed to be incredibly light weight.
  • chevron_rightConfiguration can be persistently stored for retrieval.

Stateless Endpoints

Those who wish to treat this API as nothing but a sidecar and/or microservice to their project only need to use the following URL.

URL Description
/notify/ Used to notify one one or more specified Apprise URLs. See the Apprise Wiki if you need help constructing your URL(s).
Parameter Description
urls Used to define one or more Apprise URL(s). Use a comma and/or space to separate one URL from the next.
body Defines the message body. This field is required!
title The title to include in the notification. This is an optional field.
type This optional field defines the notification type. The possible options are:
  1. infoinfo - this is the default option if a type isn't specified.
  2. check_circlesuccess
  3. report_problemwarning
  4. cancelfailure
  • codeCurl Example
    
    								    # Notifies an email address
    curl -X POST -d '{"urls":"mailto://user:pass@gmail.com","body":"test body","title":"test title"}' \
        -H "Content-Type: application/json" \
        "http://apprise.drip.haus/notify/"

    # Notifies an email address with attachments
    curl -X POST -F 'urls=mailto://user:pass@gmail.com' \
        -F 'title=test title' \
        -F 'body=test body' \
        -F attach1=@/path/to/attachment.doc \
        -F attach2=@Screenshot-2.png \
        "http://apprise.drip.haus/notify/"
  • codePython Example
    
                        import json
    from urllib.request import Request

    payload = {
        'urls': 'mailto://user:pass@gmail.com',
        'title': 'test title',
        'body': 'test body',
    }

    # The Request
    response = Request(
        "http://apprise.drip.haus/notify/",
        json.dumps(payload).encode('utf-8'),
        {"Content-Type": "application/json"},
        method='POST',
    )
    
    								   # Notifies an email address with attachments
    import requests

    payload = {
        'urls': 'mailto://user:pass@gmail.com',
        'title': 'test title',
        'body': 'test body',
    }

    with open("my/path/to/attachment.png", 'rb') as fp:
        response = request.post("http://apprise.drip.haus/notify/",
            data=payload,
            files={'attach1':('attachment.png', fp)},
        )
  • codePHP Example
    <?php

    // The URL
    $url = 'http://apprise.drip.haus/notify/';

    //Initiate cURL.
    $ch = curl_init($url);

    //The JSON data.
    $jsonData = array(
        'urls' => 'mailto://user:pass@hotmail.com',
        'title' => 'test title',
        'body' => 'test body'
    );

    //Encode the array into JSON.
    $jsonDataEncoded = json_encode($jsonData);

    //Tell cURL that we want to send a POST request.
    curl_setopt($ch, CURLOPT_POST, 1);

    //Attach our encoded JSON string to the POST fields.
    curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonDataEncoded);

    //Set the content type to application/json
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

    //Execute the request
    $result = curl_exec($ch);

    // Close our handler
    curl_close($ch);
    ?>
    <?php
    // Sending an Attachment using PHP

    // The URL
    $url = 'http://apprise.drip.haus/notify/';

    //Initiate cURL.
    $ch = curl_init($url);

    // Prepare our File attachment
    $path = '/path/to/photo.jpg';

    // Acquire our Filename
    $fname = basename($path);

    // Get our attachment mime-type (in this case it's 'image/jpg')
    $mimeType = mime_content_type($path);

    //The multipart data.
    $data = array(
        'urls' => 'mailto://user:pass@hotmail.com',
        'title' => 'test title',
        'body' => 'test body',
        'attach1' => new CURLFile($path, $mimeType, $fname)
    );

    //Tell cURL that we want to send a POST request.
    curl_setopt($ch, CURLOPT_POST, 1);

    //Attach our data to the POST fields.
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

    //Execute the request
    $result = curl_exec($ch);

    // Close our handler
    curl_close($ch);
    ?>

Persistent Store Endpoints

The administrator of this system has disabled persistent storage.