> ## Documentation Index
> Fetch the complete documentation index at: https://generaltranslation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DPA अभियान बनाना - चरण-दर-चरण

निम्न उदाहरण यह मानता है कि आपने `twurl` का उपयोग करके अपने ऐप और उपयोगकर्ता को इंस्टॉल, कॉन्फ़िगर और ऑथराइज़ कर लिया है। `twurl` एक कमांड-लाइन टूल है, जो `cURL` की तर्ज़ पर X OAuth ऑथेंटिकेशन को सहजता से संभालता है। Ads API (और REST API) की सुविधाओं का तेज़ी से परीक्षण और डिबगिंग करने के लिए `twurl` एक बेहतरीन टूल है। अनुरोध और रिस्पॉन्स के पूरे हेडर देखने के लिए, कॉल को ट्रेस करने हेतु `-t` का उपयोग करें, जो लगभग `cURL` के `-v` विकल्प के बराबर है।

इस उदाहरण में, हम एक Dynamic Product Ads (DPA) अभियान बनाएंगे।

अकाउंट id प्राप्त करें।

```bash theme={null}
twurl -H ads-api.x.com /12/accounts/
```

```json theme={null}
{
  "request": {
    "params": {}
  },
  "data": [
    {
      "name": "Test account for @AdsAPI",
      "timezone": "America/Los_Angeles",
      "timezone_switch_at": null,
      "id": "xxxxxx",
      "created_at": "2014-03-09T00:41:49Z",
      "salt": "f9f9d5a5f23075c618da5eb1d1a9df57",
      "updated_at": "2015-01-29T00:41:49Z",
      "approval_status": "ACCEPTED",
      "deleted": false
    }
  ],
  "data_type": "account",
  "total_count": 1,
  "next_cursor": null
}
```

funding instrument id प्राप्त करें।
पिछले कमांड में प्राप्त अकाउंट id का उपयोग करके GET accounts/:account\_id/funding\_instruments API को एक्सेस करें।

```bash theme={null}
twurl -H ads-api.x.com /12/accounts/xxxxxx/funding_instruments
```

```json theme={null}
{
  "data": [
    {
      "cancelled": true,
      "created_at": "2014-03-09T00:41:49Z",
      "credit_limit_local_micro": null,
      "currency": "USD",
      "deleted": false,
      "description": null,
      "end_time": null,
      "funded_amount_local_micro": null,
      "id": "yyyy",
      "type": null,
      "updated_at": "2014-05-29T00:41:49Z"
    }
  ],
  "data_type": "funding_instrument",
  "next_cursor": null,
  "request": {
    "params": {
      "account_id": "xxxxxx"
    }
  },
  "total_count": 1
}
```

<div id="step-1-create-campaign">
  ## चरण 1: अभियान बनाएँ
</div>

एक अभियान बनाएँ और उसे funding instrument से लिंक करें।
अभियान के लिए प्रारंभ समय और बजट निर्धारित करें।

* आवश्यक फ़ील्ड्स: funding instrument, अभियान का नाम, बजट (कुल/दैनिक), प्रारंभ समय और ads account ID

```bash theme={null}
twurl -H ads-api.x.com -d "funding_instrument_id={FUNDING_INSTRUMENT_ID}&name={CAMPAIGN_NAME}&total_budget_amount_local_micro={TOTAL_BUDGET}&daily_budget_amount_local_micro={DAILY_BUDGET}&start_time={START_TIME}" /12/accounts/{ADS_ACCOUNT_ID}/campaigns | jq
```

<div id="step-2-create-line-item-with-sales-objective">
  ## चरण 2: Sales objective के साथ लाइन आइटम बनाएँ
</div>

campaign से जुड़ा एक लाइन आइटम बनाएँ।

* आवश्यक फ़ील्ड्स: campaign id (चरण 1 से), product type, placements, objective, goal, entity status, primary web event tag, catalog id, product set id, creative\_source, ads\_account\_id
* catalog\_id और product\_set\_id आपके shopping manager में मिल सकते हैं
* creative\_source हमेशा DYNAMIC\_PRODUCT\_CREATIVE होना चाहिए
* objective हमेशा WEBSITE\_CLICKS होना चाहिए
* goal हमेशा WEBSITE\_CONVERSIONS होना चाहिए

```bash theme={null}
twurl -H ads-api.x.com -d "campaign_id={CAMPAIGN_ID}&product_type={product_type}&placements={PLACEMENTS}&objective=WEBSITE_CLICKS&goal=WEBSITE_CONVERSIONS&entity_status={entity_status}&primary_web_event_tag={WEB_EVENT_TAG}&catalog_id={catalog_id}&product_set_id={product_set_id}&creative_source=DYNAMIC_PRODUCT_CREATIVE" /12/accounts/{ADS_ACCOUNT_ID}/line_items | jq
```

* इस चरण के बाद, अभियान X के Ads Manager में देखा जा सकेगा।

<div id="step-3-create-dpa-card">
  ## चरण 3: DPA कार्ड बनाएँ
</div>

एक DPA कार्ड बनाएँ।

* आवश्यक पैरामीटर: ads account ID और URL:
* URL की शुरुआत [https://twitter.com](https://twitter.com) से होनी चाहिए - इसके बाद नीचे दिए गए उदाहरण की तरह कोई भी अतिरिक्त UTM जोड़ा जा सकता है:
  * `https://twitter.com?utm_source=%7B%7Bsite_source%7D%7D`
* वैकल्पिक रूप से, आप creative\_type में निम्न में से कोई एक मान देकर अपने कार्ड का फ़ॉर्मैट चुन सकते हैं: "CAROUSEL", "SINGLE", "COLLECTION". यदि इसे निर्दिष्ट नहीं किया जाता है, तो आपका कार्ड carousel कार्ड के रूप में बनाया जाएगा।

```bash theme={null}
twurl -X POST -H ads-api.twitter.com -A "Content-Type: application/json" "/12/accounts/{ADS_ACCOUNT_ID}/dynamic_product_cards" -d '{"url": "{URL}", "creative_type": "{CREATIVE_TYPE}"}' | jq
```

<div id="step-4-create-post">
  ## चरण 4: पोस्ट बनाएँ
</div>

एक पोस्ट बनाएँ।

* आवश्यक पैरामीटर: ads account ID, user ID, card URI (चरण 3 से), text, name, & dynamic product ad
* dynamic\_product\_ad को हमेशा true पर सेट होना चाहिए

```bash theme={null}
twurl -X POST -H "https://ads-api.twitter.com" "/12/accounts/{ADS_ACCOUNT_ID}/tweet?as_user_id={USER_ID}1&card_uri=card%3A%2F%2F{CARD_URI}&text={POST_TEXT}&name={POST_NAME}%201&dynamic_product_ad=true" | jq
```

<div id="step-5-associate-post-with-line-item">
  ## चरण 5: पोस्ट को लाइन आइटम के साथ संबद्ध करें
</div>

पोस्ट को लाइन आइटम के साथ संबद्ध करें।

* आवश्यक पैरामीटर: ads account id, line item id (चरण 2 से) और Tweet id (चरण 4 का id\_str)

```bash theme={null}
twurl -X POST -H "https://ads-api.twitter.com" "/12/accounts/{ADS_ACCOUNT_ID}/promoted_tweets?line_item_id={line_item_id}&tweet_ids={tweet_id}" | jq
```

यदि विज्ञापनदाता UI में कार्ड देखना चाहते हैं, तो वह वहाँ भी उपलब्ध होगा।
