How to get the Exception Details Through API?

Hi ,

I have scenario to get the System and business exception details from the specified queue, i try API but it have only queue Definitions.any one know about how to get the exception details from the queue using API or any other methods.

Regards
Prakash

1 Like

GetQueueItems.xaml (6.1 KB)

Please check this…! @prakaz25

Thanks!

1 Like

@kadiravan_kalidoss Thank you so much for quick reply. this is the thing what i expected but have one more problem if we using GetQueueItems activities it will return only top 100 records,
Is there any solution from the API side?

1 Like

Get AuthenticationToken using below function :slight_smile:
static public string Authentication()
{
string baseUrl = “http://OrchestratorURL/” + “api/account/authenticate”;
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add(“tenancyName”, “”);
parameters.Add(“usernameOrEmailAddress”, “”);
parameters.Add(“password”, “”);
HttpClient client = new HttpClient();
MultipartFormDataContent form = new MultipartFormDataContent();
HttpContent DictionaryItems = new FormUrlEncodedContent(parameters);
form.Add(DictionaryItems);
var encodedContent = new FormUrlEncodedContent(parameters);
HttpResponseMessage response = null;
try
{
response = (client.PostAsync(baseUrl, encodedContent)).Result;
dynamic json = JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result);
return json[“result”];
}
catch (Exception ex)
{
return ex.Message;
}
}

// Function to get all queue details
static public string GetQueueDetails(string AccessToken, string QueueId)
{

        string baseUrl = "http://OrchestratorURL/" + "/odata/QueueItems?$filter=QueueDefinitionId eq "+QueueId;
        HttpClient client = new HttpClient();
        client.DefaultRequestHeaders.Add("Accept", "application/json");
        client.DefaultRequestHeaders.Add("Authorization", "Bearer " + AccessToken);
        HttpResponseMessage response = null;
        try
        {
            response = (client.GetAsync(baseUrl)).Result;
            dynamic json = JsonConvert.DeserializeObject(response.Content.ReadAsStringAsync().Result);
            Console.WriteLine(json); 
            return json;
        }
        catch (Exception ex)
        {
            return ex.Message;
        }
  

    }

enjoy coding … :slight_smile:

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.