.NET SDK Reference
Resource Information
Namespace: | Autodesk.Webhooks |
Assembly: | Autodesk.Webhooks.dll |
Version: | 1.0.0 |
Installing this Library
The recommended way of installing this library to your .NET project is to use the NuGet Package Manager.
- Within the NuGet Package Manager locate the Autodesk.Webhooks library.
- Follow the instructions on the NugGet documentation site to install the library.
Alternatively, from Visual Studio IDE or CLI tools:
dotnet add package Autodesk.Webhooks --version 1.0.0
Learning Resources
Source Code
The source code for this library is available at https://github.com/autodesk-platform-services/aps-sdk-net.
Code Sample
string token = "<token>";
string hookId = "<hook-id>";
WebhooksClient webhooksClient = null!;
public void Initialise()
{
// Optionally initialize SDKManager to pass custom configurations, logger, etc.
// SDKManager sdkManager = SdkManagerBuilder.Create().Build();
StaticAuthenticationProvider staticAuthenticationProvider = new StaticAuthenticationProvider(token);
// Instantiate WebhooksClient using the auth provider
webhooksClient = new WebhooksClient(authenticationProvider: staticAuthenticationProvider);
}
// Retrieves a paginated list of all the webhooks. pageState query parameter is not specified because it is requesting the first page.
public async Task GetHooksAsync()
{
Hooks getHooks = await webhooksClient.GetHooksAsync(accessToken: token, region: Region.APAC);
// get hooks next link meant for pagination
string getHooksLink = getHooks.Links.Next;
// Get list of hooks data
List<HooksData> getHooksData = getHooks.Data;
foreach (var currentHook in getHooksData)
{
string hook_Id = currentHook.HookId;
string tenant = currentHook.Tenant;
string callback_Url = currentHook.CallbackUrl;
string created_by = currentHook.CreatedBy;
string hook_event = currentHook.Event;
string created_date = currentHook.CreatedDate;
string last_updated_date = currentHook.LastUpdatedDate;
string system_hook = currentHook.System;
string creator_type = currentHook.CreatorType;
string status = currentHook.Status;
bool? auto_reactivate_hook = currentHook.AutoReactivateHook;
string hook_expiry = currentHook.HookExpiry;
}
}
Show More