> ## 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.

# DSA अनुशंसाएँ

> Facebook DSA अनुशंसाएँ प्राप्त करें

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

<PlansAvailable plans={["premium"]} maxPackRequired={false} />

अपने Facebook विज्ञापन खाते के लिए Digital Services Act (DSA) अनुशंसाएँ प्राप्त करें।

यूरोपीय संघ (EU) के Digital Services Act (DSA) द्वारा निर्धारित आवश्यकताओं के भाग के रूप में, [Facebook को EU के किसी भी हिस्से](https://www.facebook.com/business/help/605021638170961) को लक्षित करने वाले विज्ञापनों के लिए बनाए जा रहे विज्ञापन के लाभार्थी और भुगतानकर्ता को परिभाषित करने वाले स्ट्रिंग मान प्रदान करने की आवश्यकता होती है।

यह एंडपॉइंट अनुशंसित DSA लाभार्थियों और भुगतानकर्ताओं की एक सूची प्रदान करता है जिनका उपयोग पोस्ट बूस्ट करते समय किया जा सकता है।
इन फ़ील्ड्स का उपयोग [`dsaBeneficiary`](/apis/ads/facebook/boost-post#param-dsa-beneficiary) और [`dsaPayor`](/apis/ads/facebook/boost-post#param-dsa-payor) में किया जा सकता है।

<ul className="custom-bullets">
  <li>
    स्ट्रिंग्स की एक सूची (अधिकतम 25) आउटपुट करता है जिन्हें Facebook ने विज्ञापन खाते की हाल की गतिविधि के आधार पर लाभार्थी/भुगतानकर्ता होने की संभावना के रूप में पहचाना है।
  </li>

  <li>
    इन अनुशंसाओं का उपयोग [Boost Post](/apis/ads/facebook/boost-post) एंडपॉइंट में `dsaBeneficiary` और `dsaPayor` पैरामीटर के मानों के रूप में किया जा सकता है।
  </li>

  <li>
    पोस्ट बूस्ट करते समय यदि इनमें से कोई एक प्रदान किया गया है तो `dsaBeneficiary` और `dsaPayor` दोनों को एक साथ सेट करना आवश्यक है।
  </li>
</ul>

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

<HeaderAPI />

## क्वेरी पैरामीटर

<ParamField query="accountId" type="string" required>
  Facebook विज्ञापन खाते की ID जिसके लिए DSA अनुशंसाएँ प्राप्त करनी हैं। खाता ID [ad accounts endpoint](/apis/ads/facebook/get-ad-accounts) से प्राप्त की जा सकती है।
</ParamField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl \
  -H "Authorization: Bearer API_KEY" \
  -X GET https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890
  ```

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

  fetch("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890", {
        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/facebook/dsaRecommendations?accountId=1234567890', 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/facebook/dsaRecommendations?accountId=1234567890",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
      "Authorization: Bearer API_KEY"
    ],
  ]);

  $response = curl_exec($curl);
  curl_close($curl);

  echo $response;
  ?>
  ```

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

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

          var response = await client.GetAsync("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890");
          var content = await response.Content.ReadAsStringAsync();

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

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

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

  func main() {
      client := &http.Client{}
      req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890", nil)
      req.Header.Add("Authorization", "Bearer API_KEY")

      resp, _ := client.Do(req)
      body, _ := ioutil.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 GetDsaRecommendations {
      public static void main(String[] args) throws Exception {
          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
                  .uri(URI.create("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890"))
                  .header("Authorization", "Bearer API_KEY")
                  .GET()
                  .build();

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

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

  uri = URI('https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890')
  req = Net::HTTP::Get.new(uri)
  req['Authorization'] = 'Bearer API_KEY'

  res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
    http.request(req)
  }

  puts res.body
  ```
</RequestExample>

<ResponseExample>
  ```json 200: Success theme={"system"}
  {
      "status": "success",
      "dsaRecommendations": [
          "Beneficiary 1",
          "Beneficiary 2",
          "Beneficiary 3"
      ],
      "count": 1
  }
  ```

  ```json 413: DSA Recommendations Error theme={"system"}
  {
    "action": "ads",
    "status": "error",
    "code": 413,
    "message": "There was an error getting the DSA recommendations. Please try again."
  }
  ```
</ResponseExample>
