> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# अभियान प्राप्त करें

> Google Ads अभियान की स्थिति और दैनिक बजट पढ़ें, और उसके हर विज्ञापन या asset पर Google की समीक्षा देखें।

Ayrshare के माध्यम से बनाया गया Google Ads अभियान पाएँ: उसका नाम, स्थिति, दैनिक बजट, और उसके हर विज्ञापन पर Google की समीक्षा।

## हेडर पैरामीटर

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## पाथ पैरामीटर

**id** `string` *required*

अभियान बनाते समय लौटाया गया `campaignId`।

## रिस्पॉन्स

| फ़ील्ड | इसमें क्या होता है |
| - | - |
| `campaignId` | अभियान की id |
| `name` | अभियान का नाम |
| `campaignStatus` | `active` या `paused` |
| `platformStatus` | Google की अपनी स्थिति: `ENABLED`, `PAUSED`, या Google Ads में हटाए गए अभियान के लिए `REMOVED`। हटाया गया अभियान वह आख़िरी `campaignStatus` बनाए रखता है जो आपने Ayrshare के माध्यम से सेट किया था |
| `budget` | दैनिक बजट: `amount`, `currency` (विज्ञापन खाते की मुद्रा) और `type` (`daily`) |
| `ads` | हर विज्ञापन (Search) या asset (Performance Max) पर Google की समीक्षा। [विज्ञापन समीक्षा](#ad-review) देखें |

## विज्ञापन समीक्षा

Google हर नए विज्ञापन की अपनी विज्ञापन नीतियों के अनुसार समीक्षा करता है, आमतौर पर एक कार्यदिवस के भीतर। `ads` की हर पंक्ति में होता है:

| फ़ील्ड | इसमें क्या होता है |
| - | - |
| `adId` | विज्ञापन की id, जैसा Create ने लौटाया |
| `approvalStatus` | Google का निर्णय: `APPROVED`, `APPROVED_LIMITED` (सीमाओं के साथ दिखाया जाता है, उदाहरण के लिए कुछ देशों में नहीं), `AREA_OF_INTEREST_ONLY` या `DISAPPROVED`। Google के निर्णय लेने तक इसमें कोई अन्य मान होता है, जैसे `UNKNOWN` या `UNSPECIFIED` |
| `reviewStatus` | समीक्षा किस स्थिति में है, उदाहरण के लिए `REVIEW_IN_PROGRESS` या `REVIEWED` |
| `policyTopics` | किसी सीमा या अस्वीकृति के पीछे की नीतियाँ: `[{ "topic": "ALCOHOL", "type": "PROHIBITED" }]` |

अस्वीकृत विज्ञापन नहीं दिखाया जाता। उसे Google Ads में बदलें, या नीति-अनुरूप टेक्स्ट के साथ एक नया अभियान बनाएँ। जब उस समय Google की समीक्षा पढ़ी नहीं जा सकी, या उसमें कुछ सेकंड से अधिक लगे, तो `ads` छोड़ दिया जाता है; अभियान को बाद में फिर से पढ़ें।

हर रात, Ayrshare हर समीक्षा भी जाँचता है और जब Google का निर्णय बदलता है, तो `type: "reviewChanged"` के साथ एक `ads` webhook भेजता है। [Ads Action](https://www.ayrshare.com/docs/apis/webhooks/actions.md#ads-action) देखें।

## Asset समीक्षा

Google, Performance Max अभियान के हर asset की अलग-अलग समीक्षा करता है। `ads` में हर asset की एक पंक्ति होती है, जिसमें [विज्ञापन समीक्षा](#ad-review) वाले ही फ़ील्ड होते हैं, साथ में ये भी:

| फ़ील्ड | इसमें क्या होता है |
| - | - |
| `adId` | इस अभियान में asset की key: `asset:<assetGroupId>~<assetId>~<fieldType>`, या brand asset के लिए `asset:<campaignId>~<assetId>~<fieldType>` |
| `assetId` | asset के लिए Google की id |
| `fieldType` | इसका उपयोग कहाँ होता है, उदाहरण के लिए `HEADLINE`, `MARKETING_IMAGE`, `SQUARE_MARKETING_IMAGE`, `BUSINESS_NAME` या `LOGO` |
| `primaryStatus` | क्या यह दिखाया जा सकता है, उदाहरण के लिए `ELIGIBLE` या `NOT_ELIGIBLE` |

व्यवसाय नाम, लोगो और लैंडस्केप लोगो brand assets हैं, जो asset group के बजाय अभियान से जुड़े होते हैं। इनकी भी यहाँ एक पंक्ति होती है, asset group की पंक्तियों के बाद, जिसकी key अभियान की ID होती है: `asset:<campaignId>~<assetId>~<fieldType>`, जहाँ `fieldType` `BUSINESS_NAME`, `LOGO` या `LANDSCAPE_LOGO` होता है।

## त्रुटियाँ

| कोड | कब |
| - | - |
| `400` | अभियान आपका नहीं है, मौजूद नहीं है, या अब Google Ads खाते में नहीं है। तब भी, जब आपके द्वारा लिंक किया गया Google यूज़र विज्ञापन खाते तक नहीं पहुँच सकता, या Google Ads एक्सेस रद्द कर दिया गया था। |
| `370` | Google अनुरोध पूरा नहीं कर सका। फिर से प्रयास करें। |

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/google/campaigns/21534567890"
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/ads/google/campaigns/21534567890", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${API_KEY}`
  }
})
  .then((res) => res.json())
  .then((json) => console.log(json))
  .catch(console.error);
```

```python Python theme={"system"}
import requests

headers = {
    "Authorization": "Bearer API_KEY",
}

r = requests.get("https://api.ayrshare.com/api/ads/google/campaigns/21534567890", headers=headers)

print(r.json())
```

```php PHP theme={"system"}
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.ayrshare.com/api/ads/google/campaigns/21534567890",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer API_KEY"
    ]
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error: " . $err;
} else {
    echo $response;
}
?>
```

```csharp C# theme={"system"}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        var client = new HttpClient();
        client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY");

        var response = await client.GetAsync("https://api.ayrshare.com/api/ads/google/campaigns/21534567890");
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}
```

```go Go theme={"system"}
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/google/campaigns/21534567890", nil)
    req.Header.Add("Authorization", "Bearer API_KEY")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        fmt.Println("Error:", err)
        return
    }
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

```java Java theme={"system"}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class GetCampaign {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.ayrshare.com/api/ads/google/campaigns/21534567890"))
            .header("Authorization", "Bearer API_KEY")
            .GET()
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
```

```ruby Ruby theme={"system"}
require 'net/http'
require 'uri'

uri = URI.parse('https://api.ayrshare.com/api/ads/google/campaigns/21534567890')

request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer API_KEY'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

```json 200: Search Campaign theme={"system"}
{
  "status": "success",
  "platform": "google",
  "campaignId": "21534567890",
  "name": "Fall sale",
  "campaignStatus": "active",
  "platformStatus": "ENABLED",
  "budget": { "amount": 25, "currency": "USD", "type": "daily" },
  "ads": [
    {
      "adId": "71234567890",
      "approvalStatus": "APPROVED_LIMITED",
      "reviewStatus": "REVIEWED",
      "policyTopics": [{ "topic": "ALCOHOL", "type": "LIMITED" }]
    }
  ]
}
```

```json 200: Performance Max Campaign theme={"system"}
{
  "status": "success",
  "platform": "google",
  "campaignId": "21534567891",
  "name": "Fall sale PMax",
  "campaignStatus": "paused",
  "platformStatus": "PAUSED",
  "budget": { "amount": 40, "currency": "USD", "type": "daily" },
  "ads": [
    {
      "adId": "asset:6512345678~31234567890~HEADLINE",
      "assetId": "31234567890",
      "fieldType": "HEADLINE",
      "primaryStatus": "ELIGIBLE",
      "approvalStatus": "APPROVED",
      "reviewStatus": "REVIEWED",
      "policyTopics": []
    }
  ]
}
```

```json 400: Not Found theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 400,
  "message": "Campaign not found or you are not authorized to access it."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.