---
title: Retrieve Ssh Key Pair
slug: single-connect-api-3-0-3/retrieve-ssh-key-pair
description: Learn how to make a GET request using the curl command with this helpful code example. Discover how to retrieve a SSH key pair and effectively specify the URL and headers in your code. Boost your API knowledge today!
docTags: 
createdAt: 2022-11-10T14:21:49.000Z
---

{
  "id": "KuN00Ik8zcUwhwfc0T0-4",
  "data": {
    "url": "{{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [],
      "headerParameters": [
        {
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        },
        {
          "name": "Cookie",
          "type": "string",
          "example": "{{netrightCookie}}",
          "description": ""
        },
        {
          "name": "X-XSRF-TOKEN",
          "type": "string",
          "example": "{{csrftoken}}",
          "description": ""
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Retrieve Ssh Key Pair",
        "jsonExample": "{\n    \"dbId\": 404706,\n    \"userId\": \"a177be61-8850-4f03-be1c-3ce275f02c1f\",\n    \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrlwdMY1idLMS6RRONNSBeIm7WR66CogWL3+x3UEh6ORlOCUbEFKPXTN8AhEZLB20qUxm/PZ8pw7/d2hpyW2DDq4XvMNzpspZXVLmJGDsKhuXNqxCx8lVJ1/9cZ1i7eyXqa6xfij+yxICzUvsi5T3JMUfXOm5KLDvoG9hBbLTcHOzIAls0cSO+IXVelbFkfERBHz2IBXbJXPRyjVaaB+kLo9BmVCL4TYcxdU/GGCe/BDWYpzy24k4FedhfyXAes/JujE+Edyc8EwERoCOms2K6RafmzbwrLjJIbTvt6mxiJKWmplSN/cn/BLEUt+us1hECoULLIoDj9VUKTqRbanmb testuser\",\n    \"privateKey\": null,\n    \"creationTime\": 1548419866491,\n    \"expirationTime\": null\n}"
      }
    ],
    "contentType": "application/json",
    "description": "This method retrieves the public SSH key that is authorized for logged in user.",
    "examples": {
      "languages": [
        {
          "id": "QMzVWpF5l9_eGYDlMolG9",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url {{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair \\\n     --header 'accept: application/json'"
        },
        {
          "id": "I0DOPoTpzORsVZjjbYAaN",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"{{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "nL3im2n5i1OsYz6LEBGKA",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"{{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "JnZ0W3CqJ6jWlONAIiPjI",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"{{url}}/aioc-rest-web/rest/sc/ssh/retrieveSshKeyPair\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "QMzVWpF5l9_eGYDlMolG9"
    },
    "results": {
      "languages": [
        {
          "id": "KXvZMZmXLwya92tC-lF2O",
          "language": "200",
          "code": "{\n    \"dbId\": 404706,\n    \"userId\": \"a177be61-8850-4f03-be1c-3ce275f02c1f\",\n    \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrlwdMY1idLMS6RRONNSBeIm7WR66CogWL3+x3UEh6ORlOCUbEFKPXTN8AhEZLB20qUxm/PZ8pw7/d2hpyW2DDq4XvMNzpspZXVLmJGDsKhuXNqxCx8lVJ1/9cZ1i7eyXqa6xfij+yxICzUvsi5T3JMUfXOm5KLDvoG9hBbLTcHOzIAls0cSO+IXVelbFkfERBHz2IBXbJXPRyjVaaB+kLo9BmVCL4TYcxdU/GGCe/BDWYpzy24k4FedhfyXAes/JujE+Edyc8EwERoCOms2K6RafmzbwrLjJIbTvt6mxiJKWmplSN/cn/BLEUt+us1hECoULLIoDj9VUKTqRbanmb testuser\",\n    \"privateKey\": null,\n    \"creationTime\": 1548419866491,\n    \"expirationTime\": null\n}"
        }
      ],
      "selectedLanguageId": "KXvZMZmXLwya92tC-lF2O"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}