API Monitoring - Alerts API Throwing Script Error

Hey All,

Experimenting with the Monitoring APIs and getting below error for multiple scenarios. I'm able to setup alerts via the UI, but when I run API to either GET existing or POST to create new, I get below error.

{   
  "faultstring": "Evaluation of script decodeJWT.py (py) failed with reason: \"AttributeError: 'NoneType' object has no attribute 'split'\"",   
  "detail": { "errorcode": "steps.script.ScriptEvaluationFailed" }
}

SmartDocs also gives the same error. https://apidocs.apigee.com/api-monitoring/apis/get/alerts

Am I doing something wrong?

0 12 710
12 REPLIES 12

You might be sending an invalid payload, but you shouldn't see that kind of error message. This seems pretty clearly to be a bug to me.

Let me get you in touch with someone who can help specifically on this.

Thanks Dino. Even the GET alerts is giving me the same error which has no payload.

1 other thing. I can start a new thread if needed, but this could be another bug. In the UI, I'm able to create/save an alert as long as I don't add a notification. When I try to add a notification (slack, webhook, etc) I get an error that just says "Error saving alert".

I definitely agree with @Dino-at-Google that the error message needs work. Noted with apologies.

For what it's worth the API Monitoring API doesn't yet support Basic Auth, so if you're trying to use it with username/password then it's not going to work. Instructions for how to use it with OAuth2 are at https://docs.apigee.com/api-platform/system-administration/using-oauth2.

Thanks @isaach. I'll review the OAuth2 documentation and see if anything changes. Management API's aside, I can use the UI to create alerts, I'm still unable to save them when adding a notification. Can you guys look into that?

@wesley.scott5 I'll get this looked at. Could you confirm what role you're in while accessing API Monitoring?

@isaach

I'm an Org Admin

@wesley.scott5 thanks. i'll have this looked at.

@Dino-at-Google @isaach I got the management api's working using the OAuth2, fyi.

Great, thank you for the followup.

@wesley.scott5

the issue with saving alerts should be fixed now, too

Hi @isaach

I could see the same issue.Please let me know if i miss any

curl 'https://apimonitoring.enterprise.apigee.com/alerts?org=myorg' -X GET -H 'Accept: application/json, text/plain, */*' -H "Authorization: Bearer $ACCESS_TOKEN"
{"fault":{"faultstring":"Evaluation of script decodeJWT.py (py) failed with reason: \"AttributeError: 'NoneType' object has no attribute 'split'\"","detail":{"errorcode":"steps.script.ScriptEvaluationFailed"}}}