---
title: Récupérer les étiquettes de bloc IP
slug: recuperer-les-etiquettes-de-bloc-ip
docTags: 
createdAt: 2026-06-04T15:50:56.155Z
---

{
  "id": "R-d7yQQESylcmQX_cIbtF",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.ionos.com/cloudapi/v6/ipblocks/{ipblockId}/labels/{key}",
    "servers": [
      {
        "url": "https://api.ionos.com/cloudapi/v6/ipblocks/{ipblockId}/labels/{key}"
      }
    ],
    "name": "Retrieve IP block labels",
    "description": "Retrieve the properties of the specified IP block label.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "ipblockId",
          "type": "string",
          "description": "The unique ID of the IP block."
        },
        {
          "kind": "required",
          "name": "key",
          "type": "string",
          "description": "The label key"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "optional",
          "name": "X-Contract-Number",
          "type": "integer<int32>",
          "description": "<p>Users with multiple contracts must provide the contract number, for which all API requests are to be executed.</p>",
          "format": "int32"
        }
      ],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "pretty",
          "type": "boolean",
          "description": "<p>Controls whether the response is pretty-printed (with indentations and new lines).</p>",
          "default": true
        },
        {
          "kind": "optional",
          "name": "depth",
          "type": "integer<int32>",
          "description": "<p>Controls the detail depth of the response objects.\nGET /datacenters/[ID]\n- depth=0: Only direct properties are included; children (servers and other elements) are not included.\n- depth=1: Direct properties and children references are included.\n- depth=2: Direct properties and children properties are included.\n- depth=3: Direct properties and children properties and children's children are included.\n- depth=... and so on</p>",
          "default": 0,
          "format": "int32",
          "minimum": 0,
          "maximum": 10
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "BasicAuthentication",
          "name": "BasicAuthentication",
          "kind": "optional",
          "type": "http",
          "description": "<p>You will need to base64 encode the string containing your credentials. \nNote:\n\n</p>",
          "scheme": "basic"
        },
        {
          "id": "TokenAuthentication",
          "name": "Authorization",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>Please provide header value as 'Bearer ' and don't forget to add 'Bearer' HTTP Authorization Scheme before the token.</p>",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "X-RateLimit-Remaining",
            "type": "integer<int32>",
            "description": "The number of requests that can still be made without triggering a failure response.",
            "format": "int32"
          },
          {
            "kind": "optional",
            "name": "X-RateLimit-Limit",
            "type": "integer<int32>",
            "description": "The average number of requests per minute allowed.",
            "format": "int32"
          },
          {
            "kind": "optional",
            "name": "X-RateLimit-Burst",
            "type": "integer<int32>",
            "description": "The maximum number of concurrent API requests allowed.",
            "format": "int32"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "LabelResource",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "readOnly": true,
                "description": "Label on a resource is identified using label key.",
                "example": "environment"
              },
              {
                "name": "type",
                "kind": "optional",
                "type": "string<label>",
                "readOnly": true,
                "description": "The type of object that has been created.",
                "enum": [
                  "label"
                ]
              },
              {
                "name": "href",
                "kind": "optional",
                "type": "string<uri>",
                "readOnly": true,
                "description": "<p>URL to the object representation (absolute path).</p>",
                "example": "<RESOURCE-URI>",
                "format": "uri"
              },
              {
                "name": "metadata",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/NoStateMetaData",
                "customType": "NoStateMetaData",
                "schema": [
                  {
                    "name": "etag",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "<p>Resource's Entity Tag as defined in <a href=\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11\" target=\"_blank\">http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11</a>  Entity Tag is also added as an 'ETag response header to requests which don't use 'depth' parameter.</p>",
                    "example": "45480eb3fbfc31f1d916c1eaa4abdcc3"
                  },
                  {
                    "name": "createdDate",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "The time when the resource was created.",
                    "example": "2015-12-04T14:34:09.809Z",
                    "format": "date-time"
                  },
                  {
                    "name": "createdBy",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "The user who has created the resource.",
                    "example": "user@example.com"
                  },
                  {
                    "name": "createdByUserId",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "The unique ID of the user who created the resource.",
                    "example": "user@example.com"
                  },
                  {
                    "name": "lastModifiedDate",
                    "kind": "optional",
                    "type": "string<date-time>",
                    "readOnly": true,
                    "description": "The last time the resource was modified.",
                    "example": "2015-12-04T14:34:09.809Z",
                    "format": "date-time"
                  },
                  {
                    "name": "lastModifiedBy",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "The user who last modified the resource.",
                    "example": "user@example.com"
                  },
                  {
                    "name": "lastModifiedByUserId",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "The unique ID of the user who last modified the resource.",
                    "example": "63cef532-26fe-4a64-a4e0-de7c8a506c90"
                  }
                ]
              },
              {
                "name": "properties",
                "kind": "required",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/LabelResourceProperties",
                "customType": "LabelResourceProperties",
                "schema": [
                  {
                    "name": "key",
                    "kind": "optional",
                    "type": "string",
                    "description": "A label key",
                    "example": "environment"
                  },
                  {
                    "name": "value",
                    "kind": "optional",
                    "type": "string",
                    "description": "A label value",
                    "example": "production"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/LabelResource",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "<p>Any erroneous status code: 400 (parse error), 401 (auth error), 402 (trial access), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance).</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Error",
            "schema": [
              {
                "name": "httpStatus",
                "kind": "optional",
                "type": "integer<int32>",
                "readOnly": true,
                "description": "HTTP status code of the operation.",
                "example": 400,
                "format": "int32"
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/ErrorMessage",
                "customType": "ErrorMessage[]",
                "schema": [
                  {
                    "name": "errorCode",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "Application internal error code.",
                    "example": "123"
                  },
                  {
                    "name": "message",
                    "kind": "optional",
                    "type": "string",
                    "readOnly": true,
                    "description": "<p>A human-readable message.</p>",
                    "example": "Error message example."
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "StumDYCzq4ROGVfgBKR2S",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://api.ionos.com/cloudapi/v6/ipblocks/{ipblockId}/labels/{key}?pretty=true&depth=integer%3Cint32%3E' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "qUzP0sdnyezzHWCsjsbTK",
          "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(\"https://api.ionos.com/cloudapi/v6/ipblocks/{ipblockId}/labels/{key}?pretty=true&depth=integer<int32>\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "cJwi5xrjtsCqb2JiWJlkD",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.ionos.com/cloudapi/v6/ipblocks/{ipblockId}/labels/{key}?pretty=true&depth=integer<int32>\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "xroxOPkVwnq6V8mnR2DRa",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.ionos.com/cloudapi/v6/ipblocks/{ipblockId}/labels/{key}?pretty=true&depth=integer<int32>\"\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": "StumDYCzq4ROGVfgBKR2S"
    },
    "results": {
      "languages": [
        {
          "id": "0yil_z4pee7bBj1KmHaoo",
          "language": "200",
          "code": "// Successful operation\n{\n  \"id\": \"environment\",\n  \"type\": \"\",\n  \"href\": \"<RESOURCE-URI>\",\n  \"metadata\": {\n    \"etag\": \"45480eb3fbfc31f1d916c1eaa4abdcc3\",\n    \"createdDate\": \"2015-12-04T14:34:09.809Z\",\n    \"createdBy\": \"user@example.com\",\n    \"createdByUserId\": \"user@example.com\",\n    \"lastModifiedDate\": \"2015-12-04T14:34:09.809Z\",\n    \"lastModifiedBy\": \"user@example.com\",\n    \"lastModifiedByUserId\": \"63cef532-26fe-4a64-a4e0-de7c8a506c90\"\n  },\n  \"properties\": {\n    \"key\": \"environment\",\n    \"value\": \"production\"\n  }\n}"
        },
        {
          "id": "hAkIiegFB5skTdD2KoV1o",
          "language": "default",
          "code": "// Any erroneous status code: 400 (parse error), 401 (auth error), 402 (trial access), 403 (insufficient privileges), 404 (not found), 405 (unsupported HTTP method), 415 (unsupported content type, 422 (validation error), 429 (request rate limit exceeded), 500 (server error), or 503 (maintenance).\n{\n  \"httpStatus\": 400,\n  \"messages\": [\n    {\n      \"errorCode\": \"123\",\n      \"message\": \"Error message example.\"\n    }\n  ]\n}"
        }
      ],
      "selectedLanguageId": "0yil_z4pee7bBj1KmHaoo"
    }
  },
  "children": [
    {
      "text": "",
      "id": "uVUIfvHVamfYuCtGvBbwt"
    }
  ]
}