راهنما و نمونه کدهای سی شارپ

برای استفاده از وبسرویس اینباکسینو در برنامه سی شارپ خود مطابق راهنمای زیر عمل کنید.

c sharp

فهرست راهنما

ارسال نوتیفیکیشن

اطلاعات وب سرویس

Web service for notifications (alerts) is provided in the table below. Use this web service for your notifications (alerts)

Web Service URLHeadersMethod
https://back.inboxino.com/api/access-api/message/send
  • Accept: application/json
  • Authorization: Bearer YOUR_API_TOKEN
  • api-token: YOUR_API_TOKEN
POST

نمونه کد json

Configure your notifications (alerts) according to the sample code provided below your messages, and based on the explanations provided below, send your data to the above web service to be able to send your notifications (alerts)

				
					$requestData = [
    "messages" => [
        [
            "message" => "your message type here 1",
            "message_type" => "message",
            "attachment_file" => "",
        ],
        [
            "message" => "your message type here 2 with file",
            "message_type" => "image",
            "attachment_file" => "dl1/AMFGlno94242qeBfyVuynXaF2QT9uxxZoc1RudVl.jpg",
        ]
    ],
    "recipients" => ["۰۹۳۷۶۰۸۰۴۶۷", "۰۹۱۹۹۱۵۸۴۳۹", "۰۹۱۲۹۱۵۵۴۲۵"],
    "platforms" => ["telegram", "bale", "eitaa"],
    "setting" => [
        "expired_minutes" => "",
    ],
    "with_country_code" => true,
    "country_code" => "+۹۸"
];
				
			

مشخصات پارامترها

In the table below, the types of parameters along with how to correctly send them and their explanations are provided. Please read carefully and send your messages according to the requested data.

فیلدنوعنمونه مقادیرالزامیتوضیحات
messagesArray of Objects
"messages" => [
  [
      "message" => "your first text message",
      "message_type" => "message",
      "attachment_file" => "",
  ],
  [
      "message" => "your message with image",
      "message_type" => "image",
      "attachment_file" => "image.jpg",
  ]
],
YesIt is an array of messages, and each array is the necessary data for sending each message. To send multiple messages to one number, you must place multiple arrays of messages in this section. For example, two messages will now be sent to the number 09376080467.
messageStringسلام، به اینباکسینو خوش آمدیدYesمتن پیام شما
message_typeStringmessage | image | video | file | audioYesSpecifies the type of message you are sending, and your message type can only be one of the values message | image | video | file | audio. Images, files, or … should be uploaded via the web service and placed in the attachment_file section.
attachment_fileStringimage.jpgNoIf the message you are sending contains an image, video, file, or … first upload your desired file through the Upload web service and replace the received file address in this section. Note that the message_type value must be completed according to the uploaded file. For example, if you have uploaded an image, the message_type should be sent as image.
with_fileBooleantrue or falseNoIf you want your desired file to be sent as a file in messengers so that its quality does not decrease, you must send this option as true.
recipientsArray of Strings[“۰۹۳۷۶۰۸۰۴۶۷”, “۰۹۱۹۹۱۵۸۴۳۹”, “۰۹۱۲۹۱۵۵۴۲۵”]YesPlace the list of numbers you want to send messages to in this section.
platformsArray of Strings[“telegram”, “bale”, “eitaa”,”whatsapp”,”rubika”]YesSend the platforms where you want the messages to be sent. Make sure your platform is connected to Inboxino. Select only the platforms that are active in the selected bot; otherwise, your messages will not be sent.
with_country_codeBooleantrue or falseNoIf the numbers are entered with the destination country code, this field should be off or false. If it is true, you should also send the country code (country_code).
country_codeString+۹۸NoSelect the country you want to send the message to. The country code will be added to the beginning of the numbers. So send the numbers in the recipients field without the code. The default country is Iran.
settingObject
"setting" => [
    "expired_minutes" => 3,
],
YesWith this section, you can manage how to send your messages.
expired_minutesInteger۳NoMessage expiry time. If a message, for example, is not sent within 3 minutes, it will no longer be sent.

نمونه کدهای نوتیفیکیشن JavaScript

				
					using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        // Data to send
        var requestData = new
        {
            messages = new[]
            {
                new
                {
                    message = "your first text message",
                    message_type = "message",
                    attachment_file = "",
                    with_file = false
                },
                new
                {
                    message = "your message with image",
                    message_type = "image",
                    attachment_file = "image.jpg",
                    with_file = false
                }
            },
            recipients = new[] { "09376080467", "09199158439", "09129155425" },
            platforms = new[] { "telegram", "bale", "eitaa" },
            setting = new
            {
                expired_minutes = "",
            },
            with_country_code = true,
            country_code = "+98"
        };

        // Your API token
        var apiToken = "API TOKEN";

        // API server URL
        var apiUrl = "https://back.inboxino.com/api/access-api/message/send";

        using (var client = new HttpClient())
        {
            // Set up request headers
            client.DefaultRequestHeaders.Add("Accept", "application/json");
            client.DefaultRequestHeaders.Add("Content-Type", "application/json");
            client.DefaultRequestHeaders.Add("api-token", apiToken);
            client.DefaultRequestHeaders.Add("Authorization", $"Bearer {apiToken}");

            // Convert data to JSON string
            var requestDataJson = System.Text.Json.JsonSerializer.Serialize(requestData);

            // Send the POST request
            var response = await client.PostAsync(apiUrl, new StringContent(requestDataJson, Encoding.UTF8, "application/json"));

            if (response.IsSuccessStatusCode)
            {
                var responseContent = await response.Content.ReadAsStringAsync();
                Console.WriteLine("Response Data:");
                Console.WriteLine(responseContent);
            }
            else
            {
                Console.WriteLine($"Error sending request. Status Code: {response.StatusCode}");
            }
        }
    }
}
				
			

ارسال فایل

مشخصات پارامترها

To send a file in your notification, first upload your files via the web service and replace the data according to the above documents.

Web Service URL Headers
https://dl1.inboxino.com/api/upload/:type
    • Accept: application/json
    • Authorization: Bearer YOUR_API_TOKEN
    • api-token: YOUR_API_TOKEN

نمونه کد json ارسال فایل

To send a file in your notification, first send your file via the above web service in the format shown below, then save the file path and place it in the notification web service.
				
					{
  file: "image.jpg",
}
				
			

دریافت لیست پیام‌های ارسال شده

اطلاعات وب سرویس

برای دریافت لیست پیام‌های ارسال شده می‌توانید از این وب سرویس استفاده کنید.

Web Service URLHeadersMethod
https://back.inboxino.com/api/access-api/message/notifications-log
    • Accept: application/json
    • Authorization: Bearer YOUR_API_TOKEN
    • api-token: YOUR_API_TOKEN
GET

مشخصات پارامترها

فیلدنوعنمونه مقادیرالزامیتوضیحات
sortstringlatest_sends|status|newestNoبرای مرتب کردم داده‌ها
pagenumber۱Noبرای صفحه بندی

دریافت جزئیات پیام‌های ارسال شده

اطلاعات وب سرویس

You can use this web service to retrieve a list of sent messages.

Web Service URLHeadersMethod
https://back.inboxino.com/api/access-api/message/641′,
    • Accept: application/json
    • Authorization: Bearer YOUR_API_TOKEN
    • api-token: YOUR_API_TOKEN
GET

مشخصات پارامترها

فیلدنوعنمونه مقادیرالزامیتوضیحات
idnumber۶۴۱YESنوتیفیکیشن (اعلان) ارسال شده برای دریافت لیست جزئیات پیام ها

مستندات وب سرویس اینباکسینو

افزونه وردپرس اینباکسینو

افزونه وردپرس

دانلود و راهنمای افزونه وردپرس اینباکسینو

مستندات پایتون

نمونه کد Python

مشاهده نمونه کدها و مستندات پایتون

مستندات php

نمونه کد PHP

مشاهده نمونه کدها و مستندات پی‌اچ‌پی PHP

جاوااسکریپت

نمونه کد JavaScript

مشاهده نمونه کدها و مستندات جاوااسکریپت

nodejs

نمونه کد Node JS

مشاهده نمونه کدها و مستندات نود جی‌اس