martijnsp1991 Posted January 15 Share Posted January 15 Hello, We want to send a post notification via the API, but we always get the message "Unknown system identifier". What are we doing wrong? Below is the script that is used. # Set your Pulseway API credentials $tokenID = "*********" $tokenSecret = "*************" # Pulseway API Endpoint $apiEndpoint = "https://************.pulseway.com/api/v3/notifications" # Notification details $instanceId = "Test" $title = "Testing" $message = "Test succeed" $priority = "Critical" # Create the JSON payload $jsonPayload = @{   InstanceId = $instanceId   Title    = $title   Message   = $message   Priority  = $priority } | ConvertTo-Json $jsonPayload # Set the authorization header $headers = @{   Authorization = "Basic {0}" -f [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$($tokenID):$($tokenSecret)"))   'Content-Type' = 'application/json' } # Send the API request try {   $response = Invoke-RestMethod -Uri $apiEndpoint -Method Post -Headers $headers -Body $jsonPayload   if ($response.status -eq "success") {     Write-Host "Notification sent successfully."   } else {     Write-Host "Failed to send notification. Response: $($response | ConvertTo-Json -Depth 5)"   } } catch {   Write-Host "Error occurred: $_" }  Hope someone can help us. Greeting, Martijn Link to comment Share on other sites More sharing options...
Ash Posted May 21 Share Posted May 21 Hello Martijn, To send a post notification, you need a host system through which the notification will be transmitted. This host system is identified by a unique system identifier. In the above script - "$instanceId" refers to the System Identifier. Below is how you can find the System Identifier. Select any device in the device card. You will find an alphanumeric in the URL associated to it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now