Skip to content
Ask AI

API and whitelist settings

If you want to send push notifications through the API (for example, for transactional messages triggered from your own system), you need to create an API key and whitelist your server’s IP.

Go to Najva panel > Menu > Settings > Developers (پنل نجوا > منو > تنظیمات > توسعه‌دهندگان). This page has four tabs: api key, Webhook list (لیست وب‌هوک‌ها), SMS templates (قالب‌های پیامک) and Allowed IPs (IPهای مجاز).

In the api key tab, find the SMS and push notification api key (api key پیامک و پوش‌نوتیفیکیشن) section. If you have not created a key yet, you will see the message “You currently have no api key!” (شما در حال حاضر هیچ api key ندارید!); click Create new api key (ایجاد api key جدید).

For the exact structure of an API request (sample method, headers and body), see the Najva developer documentation; this section is being rewritten, and the final version will be published there.

You do this yourself, directly from the panel; you do not need to submit a ticket:

  1. Go to Najva panel > Menu > Settings > Developers (پنل نجوا > منو > تنظیمات > توسعه‌دهندگان) and open the Allowed IPs (IPهای مجاز) tab.
  2. Click Add allowed IP (افزودن IP مجاز) and enter the IP from which push notifications will be sent. If needed, you can also add a description for it.

The “Allowed IPs” (IPهای مجاز) tab on the Najva panel developers page; the “Add allowed IP” (افزودن IP مجاز) button sits above a table showing the columns “IP address / range” (آدرس IP / رنج), “Description” (توضیحات) and “Creation date” (تاریخ ایجاد)

The registered IPs appear in this table, and you can manage each one with the three-dot menu (⋮) next to its row. Until your IP is in this list, sending push notifications through the API is not possible.

In the Webhook list tab, you can define an address so that Najva notifies your system of events. Create a webhook with the Create new webhook (ایجاد وب‌هوک جدید) button; each webhook has a title, an address and a status (active or inactive), and can be edited or deleted later.

For more questions, see the push notification FAQ.

To send push notifications through the panel, see Create and send a push campaign.