These docs are for v0.0.1. Click to read the latest docs for v1.0.61.

Discussions

Ask a Question
Back to All

CreateSubscription

Hi, When I try to create a subscription, I get the error message:

{"type":"https://developers.avayacloud.com/onecloud-ccaas/docs/error-handling","title":"Internal Server Error","status":500,"detail":"Failed to process user-based subscription. userUUID not present in the token"}

This is the code:

        Transport transport = new Transport();
        CreateSubscriptionClass createSubscription = new CreateSubscriptionClass();
        createSubscription.family = "AGENT_ENGAGEMENT";
        createSubscription.events = new String[] {"ALL"};
        transport.type = "WEBHOOK";
        transport.authTokenHeader = "auth-token";
        transport.authToken = "secreet";
        transport.endpoint = "https://www.****.nl:8443/axp/digital/callback";
        createSubscription.transport = transport;
        var options = new RestClientOptions("https://eu.cc.avayacloud.com")
        {
            MaxTimeout = -1,
        };
        var client = new RestClient(options);
        var request = new RestRequest("/api/notification/v1beta/accounts/******/subscriptions",Method.Post);
        request.AddHeader("accept", "application/json");
        request.AddHeader("content-type", "application/json");
        request.AddHeader("authorization", "Bearer " + Authenticate.GetToken());
        request.AddParameter("application/json", JsonSerializer.Serialize(createSubscription), ParameterType.RequestBody);

Where is the error message referring to?