taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

post-private-webhooks.rst (1161B)


      1 .. http:post:: [/instances/$INSTANCE]/private/webhooks
      2 
      3   This is used to create a webhook.
      4 
      5   **Required permission:** ``webhooks-write``
      6 
      7   **Request:**
      8 
      9   The request must be a `WebhookAddDetails`.
     10 
     11   **Response:**
     12 
     13   :http:statuscode:`204 No content`:
     14     The creation of the webhook is successsful.
     15 
     16   :http:statuscode:`400 Bad Request`:
     17     The request body is malformed.
     18   :http:statuscode:`404 Not found`:
     19     The merchant instance is unknown or it not in our data.
     20   :http:statuscode:`500 Internal Server Error`:
     21     The server experienced an internal failure.
     22     Returned with ``TALER_EC_GENERIC_DB_STORE_FAILED``.
     23 
     24   **Details:**
     25 
     26   .. ts:def:: WebhookAddDetails
     27 
     28     interface WebhookAddDetails {
     29 
     30       // Webhook ID to use.
     31       webhook_id: string;
     32 
     33       // The event of the webhook: why the webhook is used.
     34       event_type: WebhookEventType;
     35 
     36       // URL of the webhook where the customer will be redirected.
     37       url: string;
     38 
     39       // Method used by the webhook
     40       http_method: string;
     41 
     42       // Header template of the webhook
     43       header_template?: string;
     44 
     45       // Body template by the webhook
     46       body_template?: string;
     47 
     48    }