BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
__david__
Fluorite | Level 6

Hi everyone,

I am trying to use REST call to reactivate a closed alert so I found this one: https://developer.sas.com/rest-apis/svi-alert/createPerformActions
and the code I wrote works and reactivates the alert properly.
Then I made a loop that will loop through a list of alerts and reactivate every one of them, but that only works for the first one, all other alerts give this response:

{"errorCode":403,"message":"Forbidden","details":["path: /svi-alert/alertActions/REACTIVATE"],"links":[],"version":2,"httpStatusCode":403}
This also happens if I try to reactivate only one alert. The first one reactivates, and every other returns 403 Forbidden.
But when I click the "Reset SAS Session" button in SAS Studio, and try again, it works again. 

So I thought that it is due to the bearer token of the session and that I need a new token for every alert I wanted to reactivate and I put that inside of a loop, but it still returned forbidden for all other alerts.

Does anyone have any idea on why it works only the first time the session is opened? This is the first time I had problem like this, other endpoints are working very well even in loops when doing something to multiple alerts.
What else is changed when I reset the session, do I need to reset some other token other than bearer in order to reactivate multiple alerts at once?

Thanks,
David

1 ACCEPTED SOLUTION

Accepted Solutions
__david__
Fluorite | Level 6

FYI
I found out what was wrong.

The payload was in the wrong format... I was trying with this payload:

{ "items": [
  {
    "alertIds": ["alert1"],
    "actionType": "REACTIVATE",
    "user": "user"
  },
  {
    "alertIds": ["alert2"],
    "actionType": "REACTIVATE",
    "user": "user"
  },
  {
    "alertIds": ["alert3"],
    "actionType": "REACTIVATE",
    "user": "user"
  }
]}

But it should be like this:

{ "items": [
  {
    "alertIds": ["alert1", "alert2", "alert3"],
    "actionType": "REACTIVATE",
    "user": "user"
  }
]}


Hope this helps someone 🙂

Regards,
David

View solution in original post

1 REPLY 1
__david__
Fluorite | Level 6

FYI
I found out what was wrong.

The payload was in the wrong format... I was trying with this payload:

{ "items": [
  {
    "alertIds": ["alert1"],
    "actionType": "REACTIVATE",
    "user": "user"
  },
  {
    "alertIds": ["alert2"],
    "actionType": "REACTIVATE",
    "user": "user"
  },
  {
    "alertIds": ["alert3"],
    "actionType": "REACTIVATE",
    "user": "user"
  }
]}

But it should be like this:

{ "items": [
  {
    "alertIds": ["alert1", "alert2", "alert3"],
    "actionType": "REACTIVATE",
    "user": "user"
  }
]}


Hope this helps someone 🙂

Regards,
David

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 546 views
  • 0 likes
  • 1 in conversation