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

# Reddit API

> خيارات النشر باستخدام Reddit API

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>)}
  </>;

## النشر إلى Reddit

فيما يلي معلمات النص المطلوبة للنشر باستخدام Reddit API. يُرجى التأكد من أن الـ subreddit يسمح بالنشر الآلي.
يُرجى الاطلاع على [إرشادات وسائط Reddit](/media-guidelines/reddit) و[تفويض Reddit](/dashboard/connect-social-accounts/reddit) لمزيد من المعلومات.

```json Reddit Post theme={"system"}
{
  "post": "Reddit post", // empty string is allowed
  "platforms": ["reddit"], // required
  "redditOptions": {
    "title": "Reddit Post Title", // required
    "subreddit": "test", // required (no "/r/" needed)
    "link": "https://www.website.com" // optional: post a link
  }
}
```

<ul class="custom-bullets">
  <li>`title` (مطلوب): عنوان المنشور على Reddit.</li>

  <li>
    `subreddit` (مطلوب): الـ subreddit لإرسال المنشور. يُرجى التأكد من اتباع إرشادات النشر
    للـ subreddit. Subreddit جيد للاستخدام للاختبار هو */r/test/* ويمكن عرضه على:
    [https://www.reddit.com/r/test/](https://www.reddit.com/r/test/)
  </li>

  <li>
    `link` (اختياري): إذا كنت تنشر على Reddit وتريد نشر رابط بدلاً من نص إلى
    subreddit. بينما لا يزال نص المعلمة `post` مطلوبًا، فإنه لا يتم تضمينه في المنشور
    لأن روابط Reddit لا يمكن أن تحتوي على نص.
  </li>
</ul>

<Warning>
  تحقق دائمًا من قواعد الـ subreddit قبل النشر. تحتوي بعض subreddits على عتبة karma
  أو تتطلب العضوية لفترة زمنية أو تحد من تكرار النشر أو لا تسمح بالصور أو
  تتطلب إضافة flair. أيضًا، تحتوي معظم subreddits على قواعد محددة بشأن البريد العشوائي والترويج الذاتي.
  عدم اتباع هذه القواعد يمكن أن يؤدي إلى الحظر من قبل الـ subreddit أو Reddit.
</Warning>

## نشر صورة إلى Reddit

انشر صورة إلى Reddit إما بتضمين عنوان URL للصورة في معلمة `mediaUrl` أو معلمة `link` من `redditOptions`. الصور المنشورة كـ `link` ستُحل إلى الصورة الكاملة.

يتم تجاهل نص معلمة `post`، ولكنه لا يزال مطلوبًا لتقديم المنشور بنجاح. يقيد Reddit نشر الصور والنصوص معًا لمحرره عبر الإنترنت "fancy pants". هذا يعني أنه يمكن نشر إما صورة أو نص، ولكن ليس كلاهما في نفس الوقت.

```json Reddit Post with Image theme={"system"}
{
  "post": "Reddit post", // required, but not added to the post
  "platforms": ["reddit"], // required
  "mediaUrls": "https://my-media-url.com",
  "redditOptions": {
    "title": "Reddit Post Title", // required
    "subreddit": "test" // required (no "/r/" needed)
  }
}
```

## إضافة Reddit Flair

تتطلب بعض subreddits flair. يحدد مشرفو الـ subreddit الـ flair مسبقًا وكل flair له معرف فريد. في منشور Reddit إلى Ayrshare، أضف معرف الـ flair ونص flair اختياري إذا كان يمكن تجاوز النص.

```json Reddit Post with Flair theme={"system"}
{
  "redditOptions": {
    "flairId": "jM8nH92enjswas", // Id of the flair
    "flairText": "My New Flair text" // Override the flair text if allowed by flair
  }
}
```

يمكنك العثور على معرف flair لـ subreddit عن طريق استدعاء نقطة نهاية [/post/redditFlair](/apis/utils/reddit-get-flair).

## التحقق مما إذا كان Subreddit موجودًا

تحقق مما إذا كان subreddit موجودًا باستخدام [نقطة نهاية /validate](/apis/validate/check-subreddit).

## إضافة تنسيق نص منسق إلى منشورات Reddit

إذا كنت تريد إضافة نص عريض أو مائل أو مرتفع إلى منشور Reddit، فاستخدم [Reddit-flavored Markdown](https://www.reddit.com/wiki/markdown#wiki_new_reddit-flavored_markdown).

```json Reddit Post with Rich Text theme={"system"}
{
  "post": "For example, this can be *italic* or **bold** or ^super ",
  "platforms": ["reddit"],
  "redditOptions": {
    "title": "Rich Text Post",
    "subreddit": "test"
  }
}
```

## إشارات Reddit

قم بالإشارة إلى مستخدم Reddit آخر أو subreddit.

<ul class="custom-bullets">
  <li>أشِر إلى مستخدم Reddit بإضافة `@subreddit` أو `u/username` في نص المنشور.</li>
  <li>أشِر إلى subreddit بإضافة `r/subreddit` في نص المنشور.</li>
</ul>

على سبيل المثال:

```json Reddit Post with Mention theme={"system"}
{
  "post": "The best Reddit post ever for user @ayrshare and subreddit r/SiliconValleyHBO",
  "platforms": ["reddit"]
}
```

<Warning>
  يُرجى مراجعة [القواعد المهمة](/testing/post-verification#mentions) بشأن الإشارات.
</Warning>

## حدود الأحرف

يُرجى مراجعة [حدود أحرف Reddit](/help-center/technical-support/character_limits#reddit-character-limits) لمزيد من المعلومات.

## نقاط نهاية إضافية

<Card title="الحصول على Reddit Flair" icon="code" href="/apis/utils/reddit-get-flair" horizontal />
