Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document webhook endpoints #242

Merged
merged 5 commits into from
Jul 28, 2023
Merged

document webhook endpoints #242

merged 5 commits into from
Jul 28, 2023

Conversation

paulfitz
Copy link
Member

@paulfitz paulfitz commented Jun 5, 2023

Start documenting endpoints related to webhooks, replacing the older unofficial _subscribe/_unsubscribe (see gristlabs/grist-core#76 (comment))

@netlify
Copy link

netlify bot commented Jun 5, 2023

Deploy Preview for grist-help-preview ready!

Name Link
🔨 Latest commit 0a60d08
🔍 Latest deploy log https://app.netlify.com/sites/grist-help-preview/deploys/64c3c63514f7e60008353e4d
😎 Deploy Preview https://deploy-preview-242--grist-help-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@paulfitz paulfitz marked this pull request as draft June 5, 2023 22:20
@paulfitz paulfitz marked this pull request as ready for review July 27, 2023 18:54
@paulfitz paulfitz changed the title add a first pass at webhook endpoints document webhook endpoints Jul 27, 2023
@alexmojaki alexmojaki self-requested a review July 28, 2023 13:29

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in GET there is:

[
    {
        "id": "xxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx",
        "fields": {
            "name": "new-project-email",
            "memo": "Send an email when a project is added",
            "url": "https://example.com/webhook/123",
            "enabled": true,
            "eventTypes": [
                "add",
                "update"
            ],
            "isReadyColumn": null,
            "tableId": "Projects",
            "unsubscribeKey": "string"
        },
        "usage": {
            "numWaiting": 0,
            "status": "idle",
            "updatedTime": 1685637500424,
            "lastSuccessTime": 1685637500424,
            "lastFailureTime": 1685637500424,
            "lastErrorMessage": null,
            "lastHttpStatus": 200,
            "lastEventBatch": {
                "$ref": null,
                "size": 1,
                "attempts": 1,
                "errorMessage": null,
                "httpStatus": 200,
                "status": "success"
            }
        }
    }
]

and it should be:

{
    "webhooks": [
    {
        "id": "xxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx",
        "fields": {
            "name": "new-project-email",
            "memo": "Send an email when a project is added",
            "url": "https://example.com/webhook/123",
            "enabled": true,
            "eventTypes": [
                "add",
                "update"
            ],
            "isReadyColumn": null,
            "tableId": "Projects",
            "unsubscribeKey": "string"
        },
        "usage": {
            "numWaiting": 0,
            "status": "idle",
            "updatedTime": 1685637500424,
            "lastSuccessTime": 1685637500424,
            "lastFailureTime": 1685637500424,
            "lastErrorMessage": null,
            "lastHttpStatus": 200,
            "lastEventBatch": {
                "$ref": null,
                "size": 1,
                "attempts": 1,
                "errorMessage": null,
                "httpStatus": 200,
                "status": "success"
            }
        }
    }
]
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in POST:

there is:

{

    "webhooks": [
        {
            "name": "new-project-email",
            "memo": "Send an email when a project is added",
            "url": "https://example.com/webhook/123",
            "enabled": true,
            "eventTypes": [
                "add",
                "update"
            ],
            "isReadyColumn": null,
            "tableId": "Projects"
        }
    ]

}

and should be:

    "webhooks": [
        {
            "fields": {
              "name": "new-project-email",
              "memo": "Send an email when a project is added",
              "url": "https://example.com/webhook/123",
              "enabled": true,
              "eventTypes": [
                  "add",
                  "update"
              ],
              "isReadyColumn": null,
              "tableId": "Projects"
          }
    ]
}

Copy link

@JakubSerafin JakubSerafin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's ok for me, thanks :)

@paulfitz paulfitz merged commit 036fa5d into master Jul 28, 2023
6 checks passed
@paulfitz paulfitz deleted the webhook-endpoints branch July 28, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants