> For the complete documentation index, see [llms.txt](https://docs.platform.gamezop.com/publishers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.platform.gamezop.com/publishers/astrozop/astrozop-notifications-content-api.md).

# Astrozop Notifications Content API

### 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.

***

### Making the request

#### API endpoint

<mark style="color:green;">`GET`</mark> `https://api.astrozop.com/v1/notification-text`

#### Headers

<table><thead><tr><th width="189.8828125">Name</th><th>Description</th></tr></thead><tbody><tr><td>Authorization: Bearer<mark style="color:red;">*</mark></td><td>You must ask your Gamezop Account Manager to get your Bearer token created for you. You can then find the Bearer token for this API under <em>Settings &#x26; Admin > API Tokens</em> within the Gamezop Business Dashboard. </td></tr></tbody></table>

#### Query parameters

<table><thead><tr><th width="189.71875">Name</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>(Optional) First name of the user to who you'll send the push notification. This should not exceed 30 characters in length.</td></tr><tr><td>birth_date</td><td>(Optional) Date of birth of the user to who you'll send the push notification. This should be formatted as YYYY-MM-DD</td></tr></tbody></table>

***

### Understanding the response

#### HTTP response codes

The API provides a JSON response with a `data` object. This, in turn, contains a `notification_content` object with all the data you need to send notifications to your users.&#x20;

{% tabs %}
{% tab title="200: OK" %}
**Expected response body:**

```json
{
  "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
}
```

{% endtab %}

{% tab title="400: Bad Request" %}
Here are the error messages you could receive:

* [*User's name must be under 30 characters*](#user-content-fn-1)[^1]
* [*Birth date should be in YYYY-MM-DD format*](#user-content-fn-2)[^2]
  {% endtab %}

{% tab title="401: Unauthorized" %}
Occurs when the Bearer Token is incorrect or not provided.
{% endtab %}

{% tab title="429: Too Many Requests" %}
Occurs when the rate limit has been exceeded.
{% endtab %}
{% endtabs %}

#### Response body content

Description given below is for the contents of the `data.notification_content` object of the API response. Other parts are self-explanatory.

<table><thead><tr><th width="190.25">Key</th><th>Description</th></tr></thead><tbody><tr><td>cta_url</td><td>The link to which you must send your user when they click on the notification. This link will always be a path on your Astrozop Unique Link (will contain your Property ID) so that ad revenue can be attributed to you.</td></tr><tr><td>cta_text</td><td>If you decide to have a button for your users in the notification, this the text to be used in the button.</td></tr><tr><td>image_url</td><td>If you want to include an image in the notification, you can use the image link provided here. Images will follow a 2:1 aspect ratio.</td></tr><tr><td>title</td><td>This is the title of the notification</td></tr><tr><td>text</td><td>This is the body of the notification</td></tr></tbody></table>

***

### Other notes

* We only provide content in English.
* Passing both `name` and `birth_date` is 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 `name` field. 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.

[^1]: Occurs when the `name` URL param exceeds 30 characters.

[^2]: Occurs when the `birth_date` is not in the correct `YYYY-MM-DD` format.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.platform.gamezop.com/publishers/astrozop/astrozop-notifications-content-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
