Request

Response

    .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.

    1. Within the NuGet Package Manager locate the Autodesk.Webhooks library.
    2. 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

    SDK to REST API Cross Reference

    Operation CategoryOperationMethodHTTP Request

    Webhooks

    Get Webhook Details

    GetHookDetailsAsync(string, string, string, Region, string, bool)

    GET /systems/{system}/events/{event}/hooks/{hook_id}

    GetHookDetailsAsync(Systems, Events, string, Region, string, bool)

    List All Webhooks for an Event

    GetSystemEventHooksAsync(string, string, Region, string, string, StatusFilter, string, bool)

    GET /systems/{system}/events/{event}/hooks

    GetSystemEventHooksAsync(Systems, Events, Region, string, string, StatusFilter, string, bool)

    List All Webhooks for a System

    GetSystemHooksAsync(string, Region, StatusFilter, string, string, bool)

    GET /systems/{system}/hooks

    GetSystemHooksAsync(Systems, Region, StatusFilter, string, string, bool)
    List All Webhooks for an App GetAppHooksAsync(Region, string, StatusFilter, Sort, string, bool) GET /app/hooks
    List All Webhooks GetHooksAsync(string, StatusFilter, Region, string, bool) GET /hooks

    Create a Webhook for an Event

    CreateSystemEventHookAsync(string, string, HookPayload, Region, string, bool)

    POST /systems/{system}/events/{event}/hooks

    CreateSystemEventHookAsync(Systems, Events, HookPayload, Region, string, bool)

    Create Webhooks for All Events

    CreateSystemHookAsync(string, HookPayload, Region, string, bool)

    POST /systems/{system}/hooks

    CreateSystemHookAsync(Systems, HookPayload, Region, string, bool)

    Delete a Webhook

    DeleteSystemEventHookAsync(string, string, string, Region, string, bool)

    DELETE /systems/{system}/events/{event}/hooks/{hook_id}

    DeleteSystemEventHookAsync(Systems, Events, string, Region, string, bool)

    Update a Webhook

    PatchSystemEventHookAsync(string, string, string, ModifyHookPayload, Region, string, bool)

    PATCH /systems/{system}/events/{event}/hooks/{hook_id}

    PatchSystemEventHookAsync(Systems, Events, string, ModifyHookPayload, Region, string, bool)

    Tokens

    Create Secret Token CreateTokenAsync(TokenPayload, Region, string, bool) POST /token
    Update Secret Token PutTokenAsync(TokenPayload, Region, string, bool) PUT /tokens/@me
    Delete Secret Token DeleteTokenAsync(Region, string, bool) DELETE /tokens/@me