---
title: Link an account to a Yahoo Japan, Facebook, Google or Jahrain account
slug: docs/demo/link-an-account-to-a-yahoo-japan-facebook-google-or-jahrain-account
description: Learn how to make a successful API POST request with this code example. Discover how to use the curl command effectively, including the essential headers and data, to effortlessly link external providers to an account. Perfect for developers seeking a cle
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "gT9XS4MD6OdEb23RRhNN7",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/link/external-providers",
    "name": "Link an account to a Yahoo Japan, Facebook, Google or Jahrain account",
    "method": "POST",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "request",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "redirectURI",
              "type": "string",
              "example": "",
              "description": "Gets or sets the RedirectURI"
            },
            {
              "kind": "optional",
              "name": "provider",
              "type": "string<Google | Facebook | yahoo-jp | Janrain>",
              "example": "",
              "description": "Gets or sets the provider type"
            },
            {
              "kind": "optional",
              "name": "locale",
              "type": "string",
              "example": "",
              "description": "The code for the language you want to use for the link experience."
            },
            {
              "kind": "optional",
              "name": "authorisationCode",
              "type": "string",
              "example": "",
              "description": "AuthorisationCode"
            },
            {
              "kind": "optional",
              "name": "accessToken",
              "type": "string",
              "example": "",
              "description": "AccessToken"
            },
            {
              "kind": "optional",
              "name": "applicationIdentifier",
              "type": "string",
              "example": "",
              "description": "ApplicationIdentifier"
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.LinkAccountRequest",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v1.LinkAccountRequest",
          "isExpanded": true,
          "description": "LinkAccountExternalProviderRequest class"
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "status",
                "type": "string",
                "example": "",
                "description": "Status"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.LinkAccountToThirdParty",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.LinkAccountToThirdParty",
            "isExpanded": true,
            "description": "LinkAccountToThirdPartyResponse"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"status\": \"Status\"\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Not Found",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to link an existing account to an existing Yahoo Japan, Facebook, Google or Jahrain account following a successful authentication via external providers.",
    "examples": {
      "languages": [
        {
          "id": "lu0FSe8KbzPAiWZ48ute2",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/accounts/link/external-providers \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "Js9bekHCfCzg-f6ggg_ww",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/link/external-providers\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "OVQWiMXm2Rlp11AetCHDw",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/link/external-providers\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "kr4EbdX48kUqSN8oZbaCt",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/link/external-providers\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "lu0FSe8KbzPAiWZ48ute2"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"status\": \"Status\"\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Not Found\n"
        },
        {
          "id": "response-3-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}