Notifications Content API
curl --request GET \
--url https://api.astrozop.com/v1/notification-text \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astrozop.com/v1/notification-text"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.astrozop.com/v1/notification-text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.astrozop.com/v1/notification-text",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.astrozop.com/v1/notification-text"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.astrozop.com/v1/notification-text")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astrozop.com/v1/notification-text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"notification_content": {
"cta_url": "https://www.astrozop.com/daily-horoscope",
"cta_text": "READ NOW",
"image_url": "https://static.astrozop.com/images/example.jpg",
"title": "Best avoid travel today, Sparsh!",
"text": "Travel plans? Think again. Today, Leos face the risk of..."
}
},
"success": true
}{
"code": 400,
"data": "Birth date should be in YYYY-MM-DD format",
"success": false,
"version": "1.2.0"
}{
"code": "401",
"data": "Invalid Bearer token",
"success": false,
"version": "1.2.0"
}INTEGRATE ASTROZOP
Astrozop Notifications Content API
The Astrozop Notifications Content API provides daily notification content that Astrozop publishers can leverage to send push notifications to their users.
GET
/
v1
/
notification-text
Notifications Content API
curl --request GET \
--url https://api.astrozop.com/v1/notification-text \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astrozop.com/v1/notification-text"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.astrozop.com/v1/notification-text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.astrozop.com/v1/notification-text",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.astrozop.com/v1/notification-text"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.astrozop.com/v1/notification-text")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astrozop.com/v1/notification-text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"notification_content": {
"cta_url": "https://www.astrozop.com/daily-horoscope",
"cta_text": "READ NOW",
"image_url": "https://static.astrozop.com/images/example.jpg",
"title": "Best avoid travel today, Sparsh!",
"text": "Travel plans? Think again. Today, Leos face the risk of..."
}
},
"success": true
}{
"code": 400,
"data": "Birth date should be in YYYY-MM-DD format",
"success": false,
"version": "1.2.0"
}{
"code": "401",
"data": "Invalid Bearer token",
"success": false,
"version": "1.2.0"
}Why have an API for notification content?
This API is designed to make it easy for Astrozop publishers to engage their users with fresh, daily content. For example, users like reading their horoscope daily. If you want to send notifications daily, you need content for the notifications. This API is here to help you with fresh new content each day! If you have your users’ names and date of births, this API will automatically also personalize the notification content for your users. For example, the notification title and text could contain the user’s name, or their sun sign (derived from the user’s birth date). This API ensures that you can keep your notifications relevant and engaging, without the need to manually create content every day, ultimately increasing user retention and interaction.Important notes
- We only provide content in English.
- Passing both
nameandbirth_dateis optional. If these parameters are provided, the content will be better personalized for the user. If they are not provided, the content will be generic. - We recommend that you only pass the first name of the user in the
namefield. Avoid passing the full name, as using first name allows for better phrasing. - Ideally, pull content from this API once each day and send it out to your users.
API specification
Authorizations
You can find the Bearer token for this API under Settings & Admin > API Tokens within the Gamezop Business Dashboard.
Query Parameters
First name of the user to whom you'll send the push notification.
Maximum string length:
30Date of birth of the user to whom you'll send the push notification. This should be formatted as YYYY-MM-DD
Was this page helpful?