import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
waap_api_path = client.waap.domains.api_paths.get(
path_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
domain_id=1,
)
print(waap_api_path.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/waap"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
waapAPIPath, err := client.Waap.Domains.APIPaths.Get(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
waap.DomainAPIPathGetParams{
DomainID: 1,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapAPIPath.ID)
}
curl --request GET \
--url https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "/api/v1/paths/{path_id}",
"method": "GET",
"api_version": "v1",
"http_scheme": "HTTP",
"first_detected": "2023-11-07T05:31:56Z",
"last_detected": "2023-11-07T05:31:56Z",
"tags": [
"sensitivedataurl",
"highriskurl"
],
"api_groups": [
"accounts",
"internal"
],
"status": "CONFIRMED_API",
"source": "API_DESCRIPTION_FILE",
"request_count": 123
}{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"title": "Feature check fail",
"type": "feature-check",
"status": 401,
"detail": "This feature is not available under your current plan. Please upgrade your plan to access this feature."
}{
"detail": "Permission denied"
}{
"title": "Resource not found",
"type": "quota-check-no-resource",
"status": 404,
"detail": "The quota resource requested does not exist. Cannot enable WAAP for this domain. Please reach out to our support team."
}{
"type": "request-validation-failed",
"title": "Request validation error.",
"status": 422,
"detail": "One or more fields have validation errors.",
"errors": [
{
"loc": [
"body",
"name"
],
"detail": "Input should be a valid string"
},
{
"loc": [
"body",
"date"
],
"detail": "Field required"
},
{
"loc": [
"query",
"limit"
],
"detail": "Field required"
}
]
}{
"type": "internal-server-error",
"title": "Internal server error.",
"status": 500,
"detail": "An unexpected condition was encountered which prevented the server from fulfilling the request."
}Retrieve an API path
Retrieve a specific API path for a domain
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
waap_api_path = client.waap.domains.api_paths.get(
path_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
domain_id=1,
)
print(waap_api_path.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/waap"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
waapAPIPath, err := client.Waap.Domains.APIPaths.Get(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
waap.DomainAPIPathGetParams{
DomainID: 1,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", waapAPIPath.ID)
}
curl --request GET \
--url https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/waap/v1/domains/{domain_id}/api-paths/{path_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "/api/v1/paths/{path_id}",
"method": "GET",
"api_version": "v1",
"http_scheme": "HTTP",
"first_detected": "2023-11-07T05:31:56Z",
"last_detected": "2023-11-07T05:31:56Z",
"tags": [
"sensitivedataurl",
"highriskurl"
],
"api_groups": [
"accounts",
"internal"
],
"status": "CONFIRMED_API",
"source": "API_DESCRIPTION_FILE",
"request_count": 123
}{
"type": "http-bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid domain name: ''''"
}{
"title": "Feature check fail",
"type": "feature-check",
"status": 401,
"detail": "This feature is not available under your current plan. Please upgrade your plan to access this feature."
}{
"detail": "Permission denied"
}{
"title": "Resource not found",
"type": "quota-check-no-resource",
"status": 404,
"detail": "The quota resource requested does not exist. Cannot enable WAAP for this domain. Please reach out to our support team."
}{
"type": "request-validation-failed",
"title": "Request validation error.",
"status": 422,
"detail": "One or more fields have validation errors.",
"errors": [
{
"loc": [
"body",
"name"
],
"detail": "Input should be a valid string"
},
{
"loc": [
"body",
"date"
],
"detail": "Field required"
},
{
"loc": [
"query",
"limit"
],
"detail": "Field required"
}
]
}{
"type": "internal-server-error",
"title": "Internal server error.",
"status": 500,
"detail": "An unexpected condition was encountered which prevented the server from fulfilling the request."
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Response
Successful Response
Response model for the API path
The path ID
The API path, locations that are saved for resource IDs will be put in curly brackets
1024"/api/v1/paths/{path_id}"
The API RESTful method
GET, POST, PUT, PATCH, DELETE, TRACE, HEAD, OPTIONS The API version
32"v1"
The HTTP version of the API path
HTTP, HTTPS The date and time in ISO 8601 format the API path was first detected.
The date and time in ISO 8601 format the API path was last detected.
An array of tags associated with the API path
5A user defined tag. Tags must start with a letter and can contain only letters, numbers and spaces.
50^[a-zA-Z]+[ a-zA-Z0-9]*$["sensitivedataurl", "highriskurl"]
An array of api groups associated with the API path
["accounts", "internal"]
The status of the discovered API path
CONFIRMED_API, POTENTIAL_API, NOT_API, DELISTED_API The source of the discovered API
API_DESCRIPTION_FILE, TRAFFIC_SCAN, USER_DEFINED The number of requests for this path in the last 24 hours
Was this page helpful?