Single Software Suggestion
Perform the following steps to send single Software Suggestion.
To send single Software Suggestion:
1. | Open preferred API client or tool to initiate the request. |
2. | Proceed with software suggestion APIs using the authenticated session or token: |
Request Type |
Description |
|||||||||||||||
API |
/api/suggest-software/ |
|||||||||||||||
Method |
POST |
|||||||||||||||
Parameters |
Specify the following parameters:
|
|||||||||||||||
Response |
{ "id": 491, "name": "Microsoft Edge", "version": "137.x", "url": "https://go.microsoft.com/fwlink/?linkid=2244048", "email": "xxxx@xxxx.com", "status": 0, "research_comment": null, "comment": "testing upload, please ignore", "created": "2025-07-23T11:45:14.313187Z", "created_by": { "id": 60, "username": "xxxxx", "account": "Flexera Main Test Account" }, "details": null, "suggestion_guid": "7b767773-67ba-11f0-badc-0294354246a7", "case_id": "500cc000008OXcZAAW", "case_number": 2993076 } |
3. | After entering the above parameters, click Send to submit the request. |
PowerShell Script for Single Software Suggestion
Below is a sample PowerShell script to send single Software Suggestion:
# API endpoint
$url = "https://api.app.secunia.com/api/suggest-software/"
# Replace with your actual token
$token = "xxx"
# Payload data
$payload = @{
"email" = "xxx@xxxx.com"
"name" = "product name"
"version" = "product version"
"comment" = "add comment here"
"url" = "https://www.xxxxxx.com/"
}
# Headers with authentication
$headers = @{
"Authorization" = "Token $token"
"Content-Type" = "application/json"
}
# Convert payload to JSON
$jsonPayload = $payload | ConvertTo-Json
# Make the POST request
try {
$response = Invoke-RestMethod -Uri $url -Method Post -Headers $headers -Body $jsonPayload -ContentType "application/json"
# Print response
Write-Host "Status Code: 200" -ForegroundColor Green
Write-Host "Response:" -ForegroundColor Green
Write-Host ($response | ConvertTo-Json -Depth 10)
} catch {
Write-Host "Error occurred while uploading the file: $($_.Exception.Message)"
if ($_.Exception.Response) {
Write-Host "Response status code: $($_.Exception.Response.StatusCode.value__)"
# Check if $_.Exception.Response has a Headers property (WebException does)
if ($_.Exception.Response.Headers) {
Write-Host "Response headers: $($_.Exception.Response.Headers | ConvertTo-Json -Depth 3)" # Increase depth if needed for nested objects
}
# Check for existence of GetResponseStream before calling it
if ($_.Exception.Response.GetResponseStream) {
try {
$reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())
# Rewind the stream to the beginning if needed
if ($reader.BaseStream.CanSeek) {
$reader.BaseStream.Position = 0
}
$responseText = $reader.ReadToEnd()
Write-Host "Response content:" $responseText
}
catch {
Write-Host "Error reading response stream: $($_.Exception.Message)"
}
finally {
# Close the reader to release resources
if ($reader) {
$reader.Close()
$reader.Dispose()
}
}
}
}
else {
# Handle cases where there's no WebException.Response (e.g., network connectivity issues)
Write-Host "No specific web response available."
}
}