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

# Airtable

> Airtable से अपने उपयोगकर्ताओं के सोशल मीडिया खातों को प्रबंधित करें

## अवलोकन

[Airtable](https://www.airtable.com) एक बहुमुखी क्लाउड-आधारित प्लेटफ़ॉर्म है जो स्प्रेडशीट की संरचना को डेटाबेस की मज़बूत क्षमताओं के साथ सहजता से मिलाता है।

Airtable के ऑटोमेशन स्क्रिप्ट - जो JavaScript में लिखे गए हैं - को Ayrshare के API के साथ एकीकृत करके, आप सीधे Airtable के भीतर अपने सोशल मीडिया प्रबंधन को सुव्यवस्थित कर सकते हैं। यह एकीकरण आपको एक केंद्रीकृत स्थान से सामग्री पोस्ट करने, प्रदर्शन मेट्रिक्स का विश्लेषण करने और अपने उपयोगकर्ताओं की ओर से टिप्पणियों का प्रबंधन करने में सशक्त बनाता है।

इस मार्गदर्शिका में, हम आपको एकीकरण सेट अप करने के चरणों के बारे में बताएँगे।

## सेट अप

<Warning>
  Airtable ऑटोमेशन स्क्रिप्ट चलाने के लिए एक [paid](https://airtable.com/pricing) Airtable प्लान की आवश्यकता होती है।
  कृपया सुनिश्चित करें कि आपके Airtable प्लान में स्क्रिप्ट के साथ ऑटोमेशन शामिल है।
</Warning>

यह मार्गदर्शिका आपको दिखाती है कि [Ayrshare](https://www.ayrshare.com) के माध्यम से Airtable में लिंक किए गए सोशल मीडिया खातों पर स्वचालित रूप से कैसे पोस्ट करें।
आप किसी एकल कंपनी के सोशल खातों या अपने प्रबंधित क्लाइंट के सोशल मीडिया खातों पर पोस्ट कर सकते हैं। नीचे दिया गया सारा कोड [GitHub](https://github.com/ayrshare/airtable-post-social-media/blob/main/script.js) पर पाया जा सकता है।

<Card horizontal icon="github" href="https://github.com/ayrshare/airtable-post-social-media/blob/main/script.js" title="GitHub: Airtable Post Social Media" />

## अपनी API Key इकट्ठा करें

[Ayrshare Dashboard](https://www.ayrshare.com) में अपनी मुफ़्त या पेड प्लान API Key प्राप्त करके शुरू करें। नीचे दिए गए स्क्रिप्ट में इस कुंजी का उपयोग किया जाएगा।

यदि आप Ayrshare [Launch Plan](/multiple-users/business-launch-overview) या [Business Plan](https://www.ayrshare.com/business-plan-for-multiple-users/) पर हैं और अपने ग्राहकों की ओर से पोस्ट करना चाहते हैं, तो अपने ग्राहक की सभी Profile Keys या तो /user या /create-profile एंडपॉइंट के माध्यम से या Ayrshare Dashboard में इकट्ठा करें।

<Tip>
  सुनिश्चित करें कि आपने Ayrshare में कुछ सोशल खाते लिंक कर लिए हैं। कृपया [Ayrshare Social
  Linking page](https://app.ayrshare.com/social-accounts) पर सत्यापित करें।
</Tip>

## एक Airtable Workspace बनाएँ

[Airtable](https://www.airtable.com) में, फ़ील्ड्स के साथ एक नया वर्कस्पेस बनाएँ। कृपया सेल कॉलम को नीचे दिए गए अनुसार नाम देना सुनिश्चित करें:

<ul class="custom-bullets">
  <li>`Post` Long Text के रूप में</li>

  <li>
    `Platforms` Multi Select के रूप में इन प्रकारों के साथ: facebook, instagram, twitter, linkedin, reddit, और
    telegram
  </li>

  <li>`Images` Attachment के रूप में</li>
  <li>`Profile Keys` Single Line Text के रूप में</li>
  <li>`Status` Single Line Text के रूप में।</li>
  <li>`Schedule Date` Local Format, Include Time Field, और Time Format 24 Hours के साथ Date के रूप में</li>
</ul>

<img class="center" src="https://mintcdn.com/ayrshare/l0q1BFFPDsManw_r/images/packages-guides/airtable-example.webp?fit=max&auto=format&n=l0q1BFFPDsManw_r&q=85&s=fc87a7826895f85c3081401cf2a2a363" alt="Airtable Table Example" width="1536" height="161" data-path="images/packages-guides/airtable-example.webp" />

इन फ़ील्ड्स का उपयोग उस Airtable ऑटोमेशन स्क्रिप्ट में किया जाएगा जिसे हम अभी बनाने वाले हैं।

एक [live Airtable example](https://airtable.com/shrCWY0oA1ghB42tI/tblpnTEiPwyuViqBo) देखें।

<Card horizontal icon="book-open" href="https://airtable.com/shrCWY0oA1ghB42tI/tblpnTEiPwyuViqBo" title="Airtable Social Media Example">
  एक लाइव Airtable उदाहरण देखें
</Card>

## टेस्ट पोस्ट डेटा दर्ज करें

पोस्ट का परीक्षण करने के लिए हमें कुछ नमूना डेटा की आवश्यकता है। यहाँ एक सुझाव है:

<ul class="custom-bullets">
  <li>`Post`: *Happy New Year 2025* दर्ज करें </li>

  <li>
    `Platforms`: एक या अधिक नेटवर्क चुनें जिन्हें आपने लिंक किया है। कृपया सुनिश्चित करें कि नाम लोअरकेस में है।
  </li>

  <li>
    `Images`: एक छवि संलग्न करें। हमें यह पसंद है जिसे आप डाउनलोड और संलग्न कर सकते हैं:
    [https://img.ayrshare.com/012/gb.jpg](https://img.ayrshare.com/012/gb.jpg)
  </li>

  <li>
    `Profile Keys`: यदि आप Business Plan या Launch Plan पर हैं और किसी क्लाइंट की प्रोफ़ाइल पर पोस्ट करना चाहते हैं, तो
    उनकी Profile Key दर्ज करें। *अन्यथा, खाली छोड़ दें।*
  </li>

  <li>
    `Status`: *pending* दर्ज करें। स्क्रिप्ट केवल उन रिकॉर्ड को हथियाती है जो pending पर सेट हैं। कृपया सुनिश्चित करें
    कि "`pending` लोअरकेस में है।
  </li>

  <li>
    `Schedule Date`: खाली छोड़ दें क्योंकि हम अभी तत्काल पोस्टिंग का परीक्षण करेंगे। बाद में आप पोस्ट को शेड्यूल करने के लिए
    एक भविष्य की तारीख चुन सकते हैं।
  </li>
</ul>

## Script Editor के साथ एक ऑटोमेशन स्क्रिप्ट बनाएँ

अब हम Airtable ऑटोमेशन स्क्रिप्ट बनाएँगे जो आपकी तालिका से आपका डेटा पढ़ती है, एक पोस्ट बनाती है, और उसे Ayrshare के माध्यम से सोशल नेटवर्क पर भेजती है। आप Airtable स्क्रिप्ट संपादक का उपयोग करेंगे।

### ट्रिगर जोड़ें

* वर्कस्पेस में, *Automation* पर क्लिक करें और फिर *+New automation.*

<img class="center" src="https://mintcdn.com/ayrshare/l0q1BFFPDsManw_r/images/packages-guides/new%20automation.webp?fit=max&auto=format&n=l0q1BFFPDsManw_r&q=85&s=10edf2692d7ded6763c2dfa79684a2a0" alt="Go to the Automation section of Airtable" width="932" height="144" data-path="images/packages-guides/new automation.webp" />

<ul class="custom-bullets">
  <li>ऑटोमेशन का नाम दें।</li>
  <li>*Choose a Trigger* पर क्लिक करें।</li>
  <li>When a Record is Created चुनें।</li>
  <li>उपरोक्त फ़ील्ड्स वाली तालिका चुनें।</li>
  <li>Done पर क्लिक करें।</li>
</ul>

## एक्शन जोड़ें

<ul class="custom-bullets">
  <li>*Add Action* पर क्लिक करके शुरू करें।</li>
  <li>*Run Script* चुनें। आप स्क्रिप्ट संपादक में लाए जाएँगे।</li>
</ul>

निम्न पंक्ति को **हटाएँ**:

```javascript theme={"system"}
console.log(`Hello, ${base.name}!`);
```

और स्क्रिप्ट संपादक में निम्न कोड को **कॉपी और पेस्ट करें**:

```javascript theme={"system"}
const API_KEY = "Your API Key"; // Get a free key at app.ayrshare.com

console.log(`Starting Post ${base.name}!`);

const sendPost = async (data) => {
  const { post, platforms, imageUrls, profileKeys, scheduleDate, shortenLinks } = data;

  const body = Object.assign(
    {},
    post && { post },
    platforms && { platforms },
    profileKeys && { profileKeys: profileKeys.split(",") },
    Array.isArray(imageUrls) &&
      imageUrls.length > 0 && {
        mediaUrls: imageUrls.map((image) => image.url)
      },
    scheduleDate && { scheduleDate },
    shortenLinks !== undefined && shortenLinks !== null && { shortenLinks }
  );

  console.log("Posting JSON:", JSON.stringify(body, null, 2));

  if (profileKeys) {
    body.profileKeys = profileKeys.split(",");
  }

  const response = await fetch("https://api.ayrshare.com/api/post", {
    method: "POST",
    body: JSON.stringify(body),
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${API_KEY}`
    }
  }).then((res) => res.json());

  return response;
};

const table = base.getTable("Posts");
const query = await table.selectRecordsAsync();
const filteredRecords = query.records.filter((record) => {
  const status = record.getCellValue("Status");
  return status === "pending";
});

for (let record of filteredRecords) {
  const post = record.getCellValue("Post");
  const images = record.getCellValue("Images");
  const platforms = record.getCellValue("Platforms");
  const profileKeys = record.getCellValue("Profile Keys");
  const scheduleDate = record.getCellValue("Schedule Date");

  const shortenLinks = false;
  const response = await sendPost({
    post,
    platforms: platforms.map((x) => x.name),
    imageUrls: images,
    profileKeys,
    scheduleDate,
    shortenLinks
  });

  console.log(response);

  if (response) {
    let status;
    if (Array.isArray(response)) {
      status = response.map((x) => x.status).every((x) => x === "success") ? "success" : "error";
    } else {
      status = response.status;
    }

    await table.updateRecordAsync(record, {
      Status: status
    });
  }
}
```

यह कोड आपकी तालिका से पढ़ेगा और Ayrshare पर पोस्ट करेगा। हालाँकि, आपको पहले अपनी API Key (ऊपर से एकत्रित) जोड़नी होगी।

`Your API Key` को अपनी वास्तविक API कुंजी से बदलें।

## स्क्रिप्ट का परीक्षण करें

स्क्रिप्ट संपादक में, *>Test* दबाएँ

स्क्रिप्ट चलेगी और API कॉल से प्रतिक्रिया आउटपुट करेगी। यदि सब कुछ काम कर गया, तो आपको एक सफलता संदेश लौटा हुआ दिखाई देगा, आपके रिकॉर्ड में pending फ़ील्ड success में बदल जाएगा, और आपकी पोस्ट चयनित सोशल नेटवर्क पर होगी।

एक बार जब आप तालिका में एक नया रिकॉर्ड बनाते हैं, तो स्क्रिप्ट चलेगी और pending रिकॉर्ड्स को प्रोसेस करेगी।

## Airtable दस्तावेज़

यदि आप अधिक जानकारी चाहते हैं, तो [Airtable docs](https://www.airtable.com/developers) देखें।
उनके पास Airtable स्क्रिप्ट संपादक का उपयोग करने के तरीके पर विवरण हैं।

## वीडियो ट्यूटोरियल

यहाँ Automate All The Things की टीम से एक बेहतरीन वीडियो ट्यूटोरियल है। यह वीडियो एक लाइव Airtable प्रोजेक्ट में Ayrshare को एकीकृत करने के तरीके पर विस्तार से बताता है।

<div class="video-container">
  <iframe width="560" height="315" src="https://www.youtube.com/embed/U_jo6f5hsyY" title="Post To Social Media From Airtable" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" />
</div>

कृपया [सोशल मीडिया के साथ Airtable को एकीकृत करने के और उदाहरण](https://www.ayrshare.com/blog/automatically-post-to-social-media-from-airtable/) देखें।

## प्रश्न

यदि आपके कोई प्रश्न या टिप्पणियाँ हैं, तो कृपया हमसे [email](mailto:contact@ayrshare.com) के माध्यम से या <a href="javascript:void(0)" onClick={() => window.Intercom && window.Intercom('show')}>हमारे साथ चैट करें</a> के माध्यम से संपर्क करें।
