Issue
When attempting to call the Red Canary API, I'm only getting an error page (as HTML) in the response, even though I'm using the correct API key and calling https://go.my.redcanary.co/openapi/v3/
.
The response error shows:
<!DOCTYPE html>
<html>
<head>
<title>Not Found</title>
<style type="text/css">
Environment
Red Canary UI
Red Canary API
Resolution
The URL being called by the API query needs to specify an operation.
See https://go.my.redcanary.co/openapi/v3/docs/index.html for API documentation, which includes the list of available operations.
As an example, instead of using https://go.my.redcanary.co/openapi/v3/
, add an operation to the end of the URL, such as endpoints:https://go.my.redcanary.co/openapi/v3/endpoints
Sample cURL command:
curl --location --request GET 'https://<subdomain>.my.redcanary.co/openapi/v3/endpoints/' \
--header 'X-Api-Key: api123456789' \
--header 'Authorization: Bearer api123456789'
Sample API from Powershell:
$GPGPublicKey = "Customer GPG Public Key from my profile here"
$RCAPIToken = "Customer API Token from Subdomain here"
$APIEndpoint = "https://<SubDomain>.my.redcanary.co/openapi/v3/endpoints"
$AuthBody = @{
"type"="apiKey"
"name"="Customer API Token from Subdomain here"
"in"="body"
}
$AuthHeader = @{
"X-Api-Key"="Customer API Token from Subdomain here"
}
Invoke-RestMethod -Uri $APIEndpoint -Headers $AuthHeader -Body $AuthBody -Method "Get"
Comments
0 comments
Please sign in to leave a comment.