Python SDK - 'Field "null" was of unexpected type' when creating a webhook

edited 09/17/21 in API & Developers
09/17/21 Edited 09/17/21
Answered - Pending Review

I'm trying to create a webhook using the smartsheet-python-sdk (2.105.1):

webhook = Smartsheet.models.webhook.Webhook(
    props={
        "name": "[redacted]",
        "callbackUrl": "[redacted]",
        "scope": "sheet",
        "scopeObjectId":"[redacted]"
        "events": ["[*.*]"],
        "version": 1
    }
)

print(webhooks.create_webhook(webhook))

I'm getting the following error, however:

{
  "result": {
    "code": 1008,
    "errorCode": 1008,
    "message": "Unable to parse request. The following error occurred: Field \"null\" was of unexpected type.",
    "name": "ApiError",
    "recommendation": "Do not retry without fixing the problem. ",
    "refId": "1dba9ihewshe0",
    "shouldRetry": false,
    "statusCode": 400
  }
}

Can someone fill me in on what I'm doing wrong here?

Answers

  • I figured it out:

    "events": ["[*.*]"],
    

    should be:

    "events": ["*.*"],
    


    Obviously, this is entirely my fault, but the error message could be a little more informative.

Sign In or Register to comment.