# প্রিসেট এপিআই

## createPreset

`POST` `https://api.pushwoosh.com/json/1.3/createPreset`

একটি নতুন প্রিসেট তৈরি করে।

#### রিকোয়েস্ট বডি

| নাম                                                     | টাইপ    | বর্ণনা                                                                                                                                        |
| -------------------------------------------------------- | ------- |----------------------------------------------------------------------------------------------------------------------------------------------------|
| auth\*                   | string  | Pushwoosh কন্ট্রোল প্যানেল থেকে [এপিআই অ্যাক্সেস টোকেন](/bn/developer/api-reference/api-identifiers/#api-access-token)।                                                                                                     |
| name\*                   | string  | প্রিসেটের নাম।                                                                                                                                       |
| applicationCode\*        | string  | [Pushwoosh অ্যাপ্লিকেশন কোড](/bn/developer/api-reference/api-identifiers/#application-code)                                                                                                                      |
| campaignCode                                             | string  | একটি [ক্যাম্পেইনের কোড](/bn/developer/api-reference/api-identifiers/#campaign-code) যেখানে আপনি এই প্রিসেটটি বরাদ্দ করতে চান।                                                                                        |
| content\*                | object  | মেসেজ কন্টেন্ট প্যারামিটার।                                                                                                                        |
| content.message\*        | string  | স্ট্রিং বা অ্যারে। মেসেজের কন্টেন্ট। যদি এটি একটি স্ট্রিং হয়, তাহলে "ডিফল্ট" ভাষা ব্যবহার করা হবে।                                                     |
| content.action                                           | object  | কাস্টম অ্যাকশন প্যারামিটার। নিচের উদাহরণটি দেখুন।                                                                                                   |
| content.userData                                         | array   | কাস্টম ইউজার ডেটা। পেলোডে "u" প্যারামিটার হিসেবে পাস করা হবে (JSON স্ট্রিং-এ রূপান্তরিত)।                                                       |
| content.properties                                       | array   | বিভিন্ন প্ল্যাটফর্মের জন্য নির্দিষ্ট কন্টেন্ট। নিচের উদাহরণটি দেখুন।                                                                                   |
| scheduling.sendRate                                      | integer | থ্রটলিং। বৈধ মান 100 থেকে 1000 পুশ/সেকেন্ড পর্যন্ত।                                                                                       |
| segmentation                                             | object  | সেগমেন্টেশন প্যারামিটার                                                                                                                            |
| segmentation.filter                                      | string  | [সেগমেন্ট (ফিল্টার) নাম](/bn/developer/api-reference/api-identifiers/#segment--filter-name)                                                                                                                                        |
| segmentation.platforms\* | array   | পূর্ণসংখ্যার অ্যারে। প্ল্যাটফর্ম আইডিগুলির তালিকা। 1 - iOS, 3 - Android, 7 - Mac OS X, 8 - Windows, 9 - Amazon, 10 - Safari, 11 - Chrome, 12 - Firefox। |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK"
}
```
</TabItem>
</Tabs>

```json title="উদাহরণ"
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H",        // required. API access token from Pushwoosh Control Panel.
    "name": "PRESET_NAME",                 // required.
    "applicationCode": "XXXXX-XXXXX",      // required. Pushwoosh application code.
    "applicationGroupCode": "AAAAA-BBBBB", // optional. Can be used instead of "applicationCode".
    "campaignCode": "CCCCC-DDDDD",         // optional. Campaign code.
    "content": {                           // required. Contains message data.
      "message": {                         // required. string or object. Message content. In case it's
        "en": "English message",           //           a string, the default language will be used.
        "fr": "French message"             //           Message content localized for different languages.
      },                                   //           Only ISO 639-1:2002 for language codes.
      "title": {                           // optional. string or object. For multilanguage, set title
        "en": "English title",             //           for each language in the object. Ignored if 
        "fr": "French title"               //           platform-specific titles are specified (e.g., 
      },                                   //           'ios_title', 'android_header', etc.; see the 
                                           //           platform-specific parameters examples in
                                           //           the /createMessage API).
      "subtitle": {                        // optional. string or object. For multilanguage, set title
        "en": "English subtitle",          //           for each language in the object. Ignored if 
        "fr": "French subtitle"            //           platform-specific subtitles are specified (e.g.,
      },                                   //           'ios_subtitle', etc.; see the platform-specific
                                           //           parameters examples in the /createMessage API).
      "action": {                          // optional. Action to be performed once a user opens a message. 
        "type": "url",                     // optional. Type of action. Available types: "url", "deepLink",
                                           //            "richMedia", "openApp"(default).
        "options": {                       // optional. Options for action types. Required for all action
                                           //           types except for "openApp".
          "url": "https://example.com",    // required for "url" action type, string. Will be shortened
                                           //           if shortener is defined.
          "shortener": 2,                  // optional. Available values: 0 - do not minimize, 2 - bit.ly.
                                           //           If no shortener is specified, bit.ly shortener will
                                           //           be used by default.  
          "richMediaCode": "BBBBB-AAAAA",  // required for "richMedia" action type, string.
                                           //           Rich Media code from Pushwoosh Control Panel.
          "id": 123,                       // required for "deepLink" action type, integer. Deep Link ID. 
          "params": {                      // optional, custom parameters, required for "deepLink" action type, array.
            "param1": "value1",
            "param2": "value2"
          }
        }
      },
      "userData": {                        // optional. Custom user data. Will be passed as "u"
        "CustomData": "value"              //           parameter in the payload (converted to JSON string).
      },
      "platforms": {
        "ios": {
          "sound": "default",
          "silent": 1,
          "ttl": 604800,
          "rootParams": {
            "rule_id": "12345",
            "screen_id": "34567"
          },
          "interruptionLevel": "active"
        },
        "android": {
          "rootParams": {
            "rule_id": "12345",
            "screen_id": "34567"
          }
        }
      }
    },
    "scheduling": {            // optional. Scheduling options.
      "sendRate": 1000         // optional. Throttling. Valid values are from 100 to 1000 pushes/second.
    },
    "segmentation": {          // required. Segmentation options.
      "filter": "FILTER NAME", // optional. Filter name from your Pushwoosh Control Panel.
      "platforms": [1, 3]      // required. The list of platforms IDs: 1 — iOS; 3 — Android;
                               //           7 — Mac OS X; 8 — Windows; 9 — Amazon; 10 — Safari;
                               //           11 — Chrome; 12 — Firefox;
    }
  }
}
```

<Aside type="note">
প্ল্যাটফর্ম-নির্দিষ্ট প্যারামিটারের জন্য, অনুগ্রহ করে [`/createMessage`](/bn/developer/api-reference/messages-api/#createmessage) দেখুন।
</Aside>

## getPreset

`POST` `https://api.pushwoosh.com/json/1.3/getPreset`

নির্দিষ্ট পুশ প্রিসেটের প্যারামিটার পুনরুদ্ধার করে।

#### রিকোয়েস্ট বডি

| নাম                                           | টাইপ   | বর্ণনা                                    |
| ---------------------------------------------- | ------ | ---------------------------------------------- |
| auth\*         | string | Pushwoosh কন্ট্রোল প্যানেল থেকে [এপিআই অ্যাক্সেস টোকেন](/bn/developer/api-reference/api-identifiers/#api-access-token)। |
| preset\_code\* | string | তথ্য পুনরুদ্ধারের জন্য পুশ [প্রিসেট কোড](/bn/developer/api-reference/api-identifiers/#preset-code)।  |

<Tabs>
<TabItem label="200">
```json
{ 
  "status_code": 200,
  "status_message": "OK",
  "response": { 
    "preset": { 
      "code": "XXXXX-XXXXX",
      "name": "Full preset",
      "page_id": 26,
      "url": null,
      "content": { 
        "en": "Some message",
        "de": "Eine Nachricht"
      },
      "properties": { 
        "ignore_user_timezone": 1,
        "ios_badges": "5",
        "ios_sound": "default",
        "ios_ttl": "43200",
        "android_sound": "Sound1.wav",
        "android_custom_icon": "icon.png",
        "android_header": "android_header",
        "android_gcm_ttl": "43200",
        "wns_type": "toast",
        "wns_content": { 
          "template": "ToastImageAndText02",
          "lang-en": { 
            "headlinetext": "Title",
            "bodytext": "super text"
          },
          "languages": ["en", "zh", "it", "sv", "de", "fr", "pt", "nl", "es"],
          "lang-zh": { 
            "headlinetext": "",
            "bodytext": ""
          },
          "lang-it": { 
            "headlinetext": "",
            "bodytext": ""
          },
          "lang-sv": { 
            "headlinetext": "",
            "bodytext": ""
          },
          "lang-de": { 
            "headlinetext": "",
            "bodytext": ""
          },
          "lang-fr": { 
            "headlinetext": "",
            "bodytext": ""
          },
          "lang-pt": { 
            "headlinetext": "",
            "bodytext": ""
          },
          "lang-nl": { 
            "headlinetext": "",
            "bodytext": ""
          },
          "lang-es": { 
            "headlinetext": "",
            "bodytext": ""
          },
          "imagesource": "https:\/\/image.com\/jpg"
        },
        "adm_sound": "song",
        "adm_custom_icon": "i5.bmp",
        "adm_header": "Amazon Header",
        "adm_ttl": "7200",
        "safari_title": "Safari title",
        "safari_action": "OK",
        "safari_url_args": ["hello.com", ""],
        "safari_ttl": "43200",
        "userdata": "{\"custom\":\"data\"}",
        "created_via": "CP",
        "user_id": 2,
        "filter_code": "1"
      },
      "platforms": [1, 3, 7, 10, 11]
    }
  }
}
```
</TabItem>
</Tabs>

```json title="উদাহরণ"
{
  "request":{
    "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel
    "preset_code": "AAAAA-BBBBB"    // required. Push preset code to retrieve information for
  }
}
```

## listPresets

`POST` `https://api.pushwoosh.com/json/1.3/listPresets`

অ্যাপের জন্য তৈরি করা প্রিসেটগুলির তালিকা পুনরুদ্ধার করে।

#### রিকোয়েস্ট বডি

| নাম                                          | টাইপ   | বর্ণনা                                    |
| --------------------------------------------- | ------ | ---------------------------------------------- |
| auth\*        | string | Pushwoosh কন্ট্রোল প্যানেল থেকে [এপিআই অ্যাক্সেস টোকেন](/bn/developer/api-reference/api-identifiers/#api-access-token)। |
| application\* | string | [Pushwoosh অ্যাপ্লিকেশন কোড](/bn/developer/api-reference/api-identifiers/#application-code)                           |

<Tabs>
<TabItem label="কোনো প্রিসেট নেই">
```json
{
  "status_code": 200, 
  "status_message": "OK", 
  "response": {
    "presets": []
  }
}
```
</TabItem>

<TabItem label="প্রিসেট তালিকা">
```json
{
  "status_code": 200, 
  "status_message": "OK", 
  "response": {
    "presets": [{
      "name": "test",
      "code": "AAAAA-BBBBB"
    }]
  }
}
```
</TabItem>
</Tabs>


```json
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H",  // required. API access token from Pushwoosh Control Panel
    "application": "XXXXX-XXXXX"     // required. Pushwoosh application code
  }
}
```

## deletePreset

`POST` `https://api.pushwoosh.com/json/1.3/deletePreset`

আপনার অ্যাকাউন্ট থেকে একটি প্রিসেট মুছে ফেলে।

#### রিকোয়েস্ট বডি

| নাম                                           | টাইপ   | বর্ণনা                                                                      |
| ---------------------------------------------- | ------ | -------------------------------------------------------------------------------- |
| auth\*         | string | Pushwoosh কন্ট্রোল প্যানেল থেকে [এপিআই অ্যাক্সেস টোকেন](/bn/developer/api-reference/api-identifiers/#api-access-token)।                                   |
| preset\_code\* | string | Pushwoosh কন্ট্রোল প্যানেল বা `/listPresets` এপিআই প্রতিক্রিয়া থেকে প্রাপ্ত [প্রিসেট কোড](/bn/developer/api-reference/api-identifiers/#preset-code)। |

<Tabs>
<TabItem label="200">
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": null
}
```
</TabItem>
</Tabs>

```json title="উদাহরণ"
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H", // required. API access token from Pushwoosh Control Panel
    "preset_code": "AAAAA-BBBBB"    // required. Code of a preset to delete 
  } 
}
```