Skip to content

Latest commit

 

History

History
565 lines (417 loc) · 19 KB

WebhookApi.md

File metadata and controls

565 lines (417 loc) · 19 KB

com.ultracart.admin.v2.Api.WebhookApi

All URIs are relative to https://secure.ultracart.com/rest/v2

Method HTTP request Description
DeleteWebhook DELETE /webhook/webhooks/{webhookOid} Delete a webhook
DeleteWebhookByUrl DELETE /webhook/webhooks Delete a webhook by URL
GetWebhookLog GET /webhook/webhooks/{webhookOid}/logs/{requestId} Retrieve an individual log
GetWebhookLogSummaries GET /webhook/webhooks/{webhookOid}/logs Retrieve the log summaries
GetWebhooks GET /webhook/webhooks Retrieve webhooks
InsertWebhook POST /webhook/webhooks Add a webhook
ResendEvent POST /webhook/webhooks/{webhookOid}/reflow/{eventName} Resend events to the webhook endpoint.
UpdateWebhook PUT /webhook/webhooks/{webhookOid} Update a webhook

DeleteWebhook

void DeleteWebhook (int? webhookOid)

Delete a webhook

Delete a webhook on the UltraCart account.

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class DeleteWebhookExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new WebhookApi(simpleKey);

            var webhookOid = 56;  // int? | The webhook oid to delete.

            try
            {
                // Delete a webhook
                apiInstance.DeleteWebhook(webhookOid);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhookApi.DeleteWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhookOid int? The webhook oid to delete.

Return type

void (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteWebhookByUrl

WebhookResponse DeleteWebhookByUrl (Webhook webhook)

Delete a webhook by URL

Delete a webhook based upon the URL on the webhook_url matching an existing webhook.

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class DeleteWebhookByUrlExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new WebhookApi(simpleKey);

            var webhook = new Webhook(); // Webhook | Webhook to delete

            try
            {
                // Delete a webhook by URL
                WebhookResponse result = apiInstance.DeleteWebhookByUrl(webhook);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhookApi.DeleteWebhookByUrl: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhook Webhook Webhook to delete

Return type

WebhookResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetWebhookLog

WebhookLogResponse GetWebhookLog (int? webhookOid, string requestId)

Retrieve an individual log

Retrieves an individual log for a webhook given the webhook oid the request id.

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class GetWebhookLogExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new WebhookApi(simpleKey);

            var webhookOid = 56;  // int? | The webhook oid that owns the log.
            var requestId = requestId_example;  // string | The request id associated with the log to view.

            try
            {
                // Retrieve an individual log
                WebhookLogResponse result = apiInstance.GetWebhookLog(webhookOid, requestId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhookApi.GetWebhookLog: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhookOid int? The webhook oid that owns the log.
requestId string The request id associated with the log to view.

Return type

WebhookLogResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetWebhookLogSummaries

WebhookLogSummariesResponse GetWebhookLogSummaries (int? webhookOid, int? limit = null, int? offset = null, string since = null)

Retrieve the log summaries

Retrieves the log summary information for a given webhook. This is useful for displaying all the various logs that can be viewed.

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class GetWebhookLogSummariesExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new WebhookApi(simpleKey);

            var webhookOid = 56;  // int? | The webhook oid to retrieve log summaries for.
            var limit = 56;  // int? | The maximum number of records to return on this one API call. (optional)  (default to 100)
            var offset = 56;  // int? | Pagination of the record set.  Offset is a zero based index. (optional)  (default to 0)
            var since = since_example;  // string | Fetch log summaries that have been delivered since this date/time. (optional) 

            try
            {
                // Retrieve the log summaries
                WebhookLogSummariesResponse result = apiInstance.GetWebhookLogSummaries(webhookOid, limit, offset, since);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhookApi.GetWebhookLogSummaries: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhookOid int? The webhook oid to retrieve log summaries for.
limit int? The maximum number of records to return on this one API call. [optional] [default to 100]
offset int? Pagination of the record set. Offset is a zero based index. [optional] [default to 0]
since string Fetch log summaries that have been delivered since this date/time. [optional]

Return type

WebhookLogSummariesResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetWebhooks

WebhooksResponse GetWebhooks (int? limit = null, int? offset = null, string sort = null, bool? placeholders = null)

Retrieve webhooks

Retrieves the webhooks associated with this application.

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class GetWebhooksExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new WebhookApi(simpleKey);

            var limit = 56;  // int? | The maximum number of records to return on this one API call. (optional)  (default to 100)
            var offset = 56;  // int? | Pagination of the record set.  Offset is a zero based index. (optional)  (default to 0)
            var sort = sort_example;  // string | The sort order of the webhooks.  See documentation for examples (optional) 
            var placeholders = true;  // bool? | Whether or not placeholder values should be returned in the result.  Useful for UIs that consume this REST API. (optional) 

            try
            {
                // Retrieve webhooks
                WebhooksResponse result = apiInstance.GetWebhooks(limit, offset, sort, placeholders);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhookApi.GetWebhooks: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
limit int? The maximum number of records to return on this one API call. [optional] [default to 100]
offset int? Pagination of the record set. Offset is a zero based index. [optional] [default to 0]
sort string The sort order of the webhooks. See documentation for examples [optional]
placeholders bool? Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. [optional]

Return type

WebhooksResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

InsertWebhook

WebhookResponse InsertWebhook (Webhook webhook, bool? placeholders = null)

Add a webhook

Adds a new webhook on the account. If you add a new webhook with the authentication_type set to basic, but do not specify the basic_username and basic_password, UltraCart will automatically generate random ones and return them. This allows your application to have simpler logic on the setup of a secure webhook.

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class InsertWebhookExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new WebhookApi(simpleKey);

            var webhook = new Webhook(); // Webhook | Webhook to create
            var placeholders = true;  // bool? | Whether or not placeholder values should be returned in the result.  Useful for UIs that consume this REST API. (optional) 

            try
            {
                // Add a webhook
                WebhookResponse result = apiInstance.InsertWebhook(webhook, placeholders);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhookApi.InsertWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhook Webhook Webhook to create
placeholders bool? Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. [optional]

Return type

WebhookResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ResendEvent

WebhookSampleRequestResponse ResendEvent (int? webhookOid, string eventName)

Resend events to the webhook endpoint.

This method will resend events to the webhook endpoint. This method can be used for example to send all the existing items on an account to a webhook.

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class ResendEventExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new WebhookApi(simpleKey);

            var webhookOid = 56;  // int? | The webhook oid that is receiving the reflowed events.
            var eventName = eventName_example;  // string | The event to reflow.

            try
            {
                // Resend events to the webhook endpoint.
                WebhookSampleRequestResponse result = apiInstance.ResendEvent(webhookOid, eventName);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhookApi.ResendEvent: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhookOid int? The webhook oid that is receiving the reflowed events.
eventName string The event to reflow.

Return type

WebhookSampleRequestResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateWebhook

WebhookResponse UpdateWebhook (Webhook webhook, int? webhookOid, bool? placeholders = null)

Update a webhook

Update a webhook on the account

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class UpdateWebhookExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new WebhookApi(simpleKey);

            var webhook = new Webhook(); // Webhook | Webhook to update
            var webhookOid = 56;  // int? | The webhook oid to update.
            var placeholders = true;  // bool? | Whether or not placeholder values should be returned in the result.  Useful for UIs that consume this REST API. (optional) 

            try
            {
                // Update a webhook
                WebhookResponse result = apiInstance.UpdateWebhook(webhook, webhookOid, placeholders);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling WebhookApi.UpdateWebhook: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
webhook Webhook Webhook to update
webhookOid int? The webhook oid to update.
placeholders bool? Whether or not placeholder values should be returned in the result. Useful for UIs that consume this REST API. [optional]

Return type

WebhookResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]