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

# Валідація JSON

> Надішліть JSON, щоб перевірити коректність форматування

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

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

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

Надішліть JSON, щоб перевірити коректність його форматування.
Ви можете валідувати JSON за допомогою онлайн-лінтера, як-от [https://jsonlint.com/](https://jsonlint.com/), або скориставшись [Postman](/testing/postman).

Якщо ви використовуєте no-code інструмент, як-от Bubble чи Make, або отримуєте відповідь 500 "Bad Request", цей ендпоінт корисний для налагодження JSON-запиту.

## Параметри заголовка

<HeaderAPI noProfileKey={true} />

<ul class="custom-bullets">
  <li>Надсилайте дані як текст. Якщо використовуєте Postman, обов'язково виберіть "Text" як тип.</li>
  <li>Встановіть `"Content-Type": "text/plain"`.</li>
</ul>

## Приклади запитів

Надішліть будь-який JSON на цей ендпоінт, щоб перевірити його.

Нижче — приклад невалідного JSON у Postman. Ви його помітите? Відсутня кома в кінці другого параметра `platforms`.

Обов'язково встановіть `Content-Type` у заголовку як `text/plain` і виберіть "Text" при надсиланні.

<img class="center" src="https://mintcdn.com/ayrshare/XRYzr5UdPjyr_kPK/images/apis/validate/json.webp?fit=max&auto=format&n=XRYzr5UdPjyr_kPK&q=85&s=a7f0b64bdf94eb52955c43fa13ee1b2d" alt="Postman Validate JSON" width="1200" height="610" data-path="images/apis/validate/json.webp" />

<RequestExample />

<ResponseExample>
  ```json 200: OK Valid JSON theme={"system"}
  {
      "status": "success",
      "message": "Valid JSON. Nice Job!"
  }
  ```

  ```json 400: Bad Request Invalid JSON theme={"system"}
  {
    "status": "error",
    "message": "JSON is not valid. Unexpected end of JSON input while parsing near '{\"test\": \"happy}'"
  }
  ```
</ResponseExample>
