Missing mandatory parameter issue
Hello, I am attempting to call an akamai SIEM endpoint using the edgegrid ruby gem.
Below is my code but I get missing mandatory parameter and unknown as to why as the akamai documentation does not have any more required params than what I am giving it already.
require 'akamai/edgegrid'
require 'net/http'
require 'uri'
baseuri = URI('https://<>.luna.akamaiapis.net/')
http = Akamai::Edgegrid::HTTP.new(
address=baseuri.host,
port=baseuri.port
)
http.setup_edgegrid(
:client_token => '<>',
:client_secret => '<>',
:access_token => '<>',
:max_body => 128 * 1024
)
puts "client setup complete"
# example of simple GET request
request = Net::HTTP::Get.new URI.join(baseuri.to_s, '/siem/v1/configs/33314').to_s
response = http.request(request)
puts response.body
For obvious reasons, I have redacted the host details and authorization details.
The output of the above is:
{
"type": "https://problems.cloudsecurity.akamaiapis.net/siem/v1/missing-parameters",
"title": "Missing mandatory parameter(s) or illegal parameter(s) in the request",
"instance": "https://<>/siem/v1/configs/33314",
"detail": "Missing mandatory parameter(s) or illegal parameter(s) in the request",
"method": "GET",
"serverIp": "<>",
"clientIp": "<>",
"requestId": "4a3717f6",
"requestTime": "2024-01-03T21:04:38Z"
}
Any suggestions as to what I could be doing incorrect?
Does it work if you add in request['Accept'] = 'application/json' before making the request?
Hi Rajiv, thanks for the quick response.
I just tried that but it did not make any difference. Still the same issue.
Hi Rajiv, I am following up -- is there another way we should be calling this API?
SIEM open api supports 2 modes offset or time-based mode - https://techdocs.akamai.com/siem-integration/recipes. To get security events from current time specify query param 'offset' as null. For example: https://<>/siem/v1/configs/33314?offset=null.
Thanks Jacob
It seems to have worked now. We were referring to the documentation https://techdocs.akamai.com/siem-integration/reference/get-configid and it does not specify offset to be required, and examples there do not use it.
Appreciate the helpful documentation above, we will refer to that one moving forward.