Quick Start
Welcome to Wuf, the mobile push notifications platform.
Wuf is the easiest way to send and receive mobile push notifications, both on iOS and Android devices. We support wearable devices too!
To send a mobile notification, you need an API key and a User key. Let's see how to obtain them.
Get the API key
Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.
You can generate an API key by creating a new app on the Wuf Dashboard, by clicking on the Create app button.
Install the mobile apps
We have mobile apps for iOS devices (iPhone, and iPad) and for Android devices.
Once installed, you'll get a User Key.
Get the User Key
A User key identifies a Wuf receiver account, and it is shared across different devices if the user logs in with the same account.
You and the users can get the User Key by installing the mobile app for iOS or Android.
The User Key will appear just after the Sign-in page on the first installation.
After that, the User Key will be accessible from the settings page, by clicking on the three dots icon.
Make your first request
To make your first request, send an authenticated request to the push endpoint.
Send push notification
POST
https://api.usewuf.com/v1/push
Request Body
The User Key (one between userKey or userGroupKey is required)
Emoji to be shown in the title and as icon in the Wuf app
Optional image to be included in the notification
Optional URL, shown in the Wuf app
The User Group Key (one between userKey or userGroupKey is required)
{
"id": "cllld08g00001ky08yqf5qdozson"
}
Take a look at how you might call this method using different languages, or via curl
:
curl https://api.usewuf.com/v1/push
-d apiKey='aeZVV0aaUA8y0Dqij_ptna'
-d userKey='uswXhaoDan2maAerZK9HZV'
-d title='New message received'
-d description='Hey, how are you doing?'
-d emoji='💬'
-d url='https://mychat.app/user/john'
const axios = require('axios');
const data = JSON.stringify({
"apiKey": "aeZVV0aaUA8y0Dqij_ptna",
"userKey": "uswXhaoDan2maAerZK9HZV",
"title": "New report",
"body": "Read the latest news",
"emoji": "📈",
"url": "https://mysite.com/report-2023",
});
var config = {
method: 'post',
url: 'https://api.usewuf.com/v1/push',
headers: {
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import http.client
import json
# Setup connection
conn = http.client.HTTPSConnection("api.usewuf.com")
# Define the endpoint
endpoint = "/v1/push"
# Create payload
payload = {
"apiKey": "aeZVV0aaUA8y0Dqij_ptna",
"userKey": "uswXhaoDan2maAerZK9HZV",
"title": "New report",
"body": "Read the latest news",
"emoji": "📈",
"url": "https://mysite.com/report-2023",
}
# Convert the payload to a JSON string
headers = {
'Content-Type': 'application/json'
}
# Send the POST request
conn.request("POST", endpoint, body=json.dumps(payload), headers=headers)
# Get the response
response = conn.getresponse()
data = response.read()
print(data.decode("utf-8"))
# Close the connection
conn.close()
require 'net/http'
require 'uri'
require 'json'
# Setup URI and HTTP
uri = URI.parse("https://api.usewuf.com/v1/push")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
# Create payload
payload = {
"apiKey" => "aeZVV0aaUA8y0Dqij_ptna",
"userKey" => "uswXhaoDan2maAerZK9HZV",
"title" => "New report",
"body" => "Read the latest news",
"emoji" => "📈",
"url" => "https://mysite.com/report-2023"
}
# Setup request
request = Net::HTTP::Post.new(uri.request_uri, {
'Content-Type' => 'application/json'
})
request.body = payload.to_json
# Make the request
response = http.request(request)
puts response.body
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.usewuf.com/v1/push"
payload := map[string]interface{}{
"apiKey": "aeZVV0aaUA8y0Dqij_ptna",
"userKey": "uswXhaoDan2maAerZK9HZV",
"title": "New report",
"body": "Read the latest news",
"emoji": "📈",
"url": "https://mysite.com/report-2023",
}
// Convert map to JSON
data, err := json.Marshal(payload)
if err != nil {
fmt.Println("Error encoding payload:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(data))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
// Read the response body
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println("Response:", string(body))
}
<?php
$url = 'https://api.usewuf.com/v1/push';
// Payload
$data = array(
"apiKey" => "aeZVV0aaUA8y0Dqij_ptna",
"userKey" => "uswXhaoDan2maAerZK9HZV",
"title" => "New report",
"body" => "Read the latest news",
"emoji" => "📈",
"url" => "https://mysite.com/report-2023"
);
// Initialize cURL session
$ch = curl_init($url);
// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json'
));
// Execute cURL session and get the response
$response = curl_exec($ch);
// Check for cURL errors
if (curl_errno($ch)) {
echo 'cURL error: ' . curl_error($ch);
} else {
echo $response;
}
// Close cURL session
curl_close($ch);
?>
PHP