Retrieve MAC filter¶
GET/
Switch Management API · MacFiltering
Get MAC filter settings for the tenant.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
Request samples¶
curl -X GET "https://api-<data-region>.central.sophos.com/switch/v1/settings/mac-filtering" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>"
import requests
response = requests.get(
"https://api-<data-region>.central.sophos.com/switch/v1/settings/mac-filtering",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api-<data-region>.central.sophos.com/switch/v1/settings/mac-filtering" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api-<data-region>.central.sophos.com/switch/v1/settings/mac-filtering", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api-<data-region>.central.sophos.com/switch/v1/settings/mac-filtering", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — MAC filter settings retrieved.¶
Response fields
tenantobjectTenant ID.
Show child attributesHide child attributes
idstring (uuid)requiredTenant ID.
createdByobjectPrincipal reference.
Show child attributesHide child attributes
idstringrequiredPrincipal email or client ID.
typestring (enum)requiredPrincipal type.
Must be one of:
Must be one of:
user, service.accountTypestringAccount type.
Must be one of:
Must be one of:
partner, tenant, organization.accountIdstring (uuid)Account ID.
createdAtstring (date-time)Timestamp when this setting is created.
updatedByobjectPrincipal reference.
Show child attributesHide child attributes
idstringrequiredPrincipal email or client ID.
typestring (enum)requiredPrincipal type.
Must be one of:
Must be one of:
user, service.accountTypestringAccount type.
Must be one of:
Must be one of:
partner, tenant, organization.accountIdstring (uuid)Account ID.
updatedAtstring (date-time)Timestamp when this setting is updated.
macAddressesarray of string (mac)requiredList of MAC addresses.
Must contain at most 256 items. Items must be unique.
Must contain at most 256 items. Items must be unique.
Errors¶
| Status | Meaning |
|---|---|
400 | Bad request. |
401 | Authentication required. |
403 | Authorization required. |
404 | Not found. |
500 | Unknown error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"macAddresses": [
"5c:85:7e:32:97:26",
"5c:85:7e:32:98:28"
],
"tenant": {
"id": "3e382b8e-49fd-4cd9-8360-a364371d7650"
},
"createdBy": {
"id": "97483e58-55d7-44fb-b03f-9422f106ef66",
"type": "user",
"accountId": "3e382b8e-49fd-4cd9-8360-a364371d7650",
"accountType": "tenant"
},
"createdAt": "2022-03-30T05:43:59.492",
"updatedBy": {
"id": "97483e58-55d7-44fb-b03f-9422f106ef66",
"type": "user",
"accountId": "3e382b8e-49fd-4cd9-8360-a364371d7650",
"accountType": "tenant"
},
"updatedAt": "2022-03-30T05:43:59.492"
}
See the guide for a narrative walkthrough of this API.