### C# HttpClient Example for Starting a Launch Source: https://developers.reportportal.io/api-docs/service-api/start-launch Demonstrates how to use HttpClient in C# to send a POST request to start a new launch. Ensure the Authorization header is correctly set with a Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v2/:projectName/launch"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"startTime\": \"2024-07-29T15:51:28.071Z\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"attributes\": [\n {\n \"key\": \"string\",\n \"value\": \"string\",\n \"system\": false\n }\n ],\n \"uuid\": \"string\",\n \"mode\": \"DEFAULT\",\n \"rerun\": true,\n \"rerunOf\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Get File Source: https://developers.reportportal.io/api-docs/service-api/get-file Demonstrates how to make a GET request to retrieve data using HttpClient in C#. Ensure the Authorization header is correctly set with a Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/data/:projectName/:dataId"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Launch API Request (C#) Source: https://developers.reportportal.io/api-docs/service-api/get-launch Example of making a GET request to retrieve launch details using HttpClient in C#. Ensure the Authorization header is correctly set with a valid Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/:projectName/launch/:launchId"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Starting a Child Item Source: https://developers.reportportal.io/api-docs/service-api/start-child-item-1 This snippet demonstrates how to use C#'s HttpClient to send a POST request to start a child item. It includes setting headers, constructing the JSON body, and handling the response. Ensure you replace `` with your actual bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v2/:projectName/item/:parentItem/"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"startTime\": \"2024-07-29T15:51:28.071Z\",\n \"launchUuid\": \"string\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"attributes\": [\n {\n \"key\": \"string\",\n \"value\": \"string\",\n \"system\": false\n }\n ],\n \"uuid\": \"string\",\n \"codeRef\": \"string\",\n \"parameters\": [\n {\n \"key\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"uniqueId\": \"string\",\n \"testCaseId\": \"string\",\n \"type\": \"SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS,BEFORE_METHOD, BEFORE_SUITE, BEFORE_TEST, AFTER_CLASS, AFTER_GROUPS, AFTER_METHOD, AFTER_SUITE, AFTER_TEST\",\n \"retry\": true,\n \"hasStats\": true,\n \"retryOf\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Getting Logs Source: https://developers.reportportal.io/api-docs/service-api/get-logs Demonstrates how to use HttpClient in C# to make a GET request to the logs endpoint. Ensure you replace `` with your actual Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/:projectName/log"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Starting a Child Item Source: https://developers.reportportal.io/api-docs/service-api/start-child-item-2 This snippet demonstrates how to use C#'s HttpClient to send a POST request to start a child item. Ensure the Authorization header is correctly set with your Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v1/:projectName/item/:parentItem"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"startTime\": \"2024-07-29T15:51:28.071Z\",\n \"launchUuid\": \"string\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"attributes\": [\n {\n \"key\": \"string\",\n \"value\": \"string\",\n \"system\": false\n }\n ],\n \"uuid\": \"string\",\n \"codeRef\": \"string\",\n \"parameters\": [\n {\n \"key\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"uniqueId\": \"string\",\n \"testCaseId\": \"string\",\n \"type\": \"SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS,BEFORE_METHOD, BEFORE_SUITE, BEFORE_TEST, AFTER_CLASS, AFTER_GROUPS, AFTER_METHOD, AFTER_SUITE, AFTER_TEST\",\n \"retry\": true,\n \"hasStats\": true,\n \"retryOf\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Get Logs Under Source: https://developers.reportportal.io/api-docs/service-api/get-logs-under Demonstrates how to use HttpClient in C# to send a POST request to the 'get logs under' endpoint. Ensure you replace `` with your actual Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v1/:projectName/log/under"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"itemIds\": [\n 0\n ],\n \"logLevel\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Start Child Item C# Example Source: https://developers.reportportal.io/api-docs/service-api/start-child-item This C# code snippet demonstrates how to send a POST request to start a child item. It includes setting the authorization header and the JSON payload with various item details. Ensure you replace `` with your actual Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v2/:projectName/item/:parentItem"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"startTime\": \"2024-07-29T15:51:28.071Z\",\n \"launchUuid\": \"string\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"attributes\": [\n {\n \"key\": \"string\",\n \"value\": \"string\",\n \"system\": false\n }\n ],\n \"uuid\": \"string\",\n \"codeRef\": \"string\",\n \"parameters\": [\n {\n \"key\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"uniqueId\": \"string\",\n \"testCaseId\": \"string\",\n \"type\": \"SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS,BEFORE_METHOD, BEFORE_SUITE, BEFORE_TEST, AFTER_CLASS, AFTER_GROUPS, AFTER_METHOD, AFTER_SUITE, AFTER_TEST\",\n \"retry\": true,\n \"hasStats\": true,\n \"retryOf\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get User Details C# Example Source: https://developers.reportportal.io/api-docs/service-uat/user-1 Example of how to call the Get User Details API using HttpClient in C#. Ensure you include the correct authorization token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/uat/sso/user"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Error Response Example Source: https://developers.reportportal.io/api-docs/service-api/get-attribute-values This example shows the structure of an error response from the Get Attribute Values API. ```APIDOC ## GET /attributeValues ### Description Retrieves attribute values. This endpoint is primarily used for error response documentation. ### Method GET ### Endpoint /attributeValues ### Parameters This endpoint does not accept any parameters. ### Request Example This endpoint does not have a request example as it is documented for error responses. ### Response #### Error Response (e.g., 400 Bad Request) - **errorCode** (string) - A specific error code indicating the issue. Possible values include: `INCORRECT_REQUEST`, `BINARY_DATA_CANNOT_BE_SAVED`, `ACCESS_DENIED`, `ADDRESS_LOCKED`, `PROJECT_NOT_FOUND`, `LAUNCH_NOT_FOUND`, `TEST_SUITE_NOT_FOUND`, `TEST_ITEM_NOT_FOUND`, `LOG_NOT_FOUND`, `ROLE_NOT_FOUND`, `USER_NOT_FOUND`, `WIDGET_NOT_FOUND`, `WIDGET_NOT_FOUND_IN_DASHBOARD`, `DASHBOARD_NOT_FOUND`, `USER_FILTER_NOT_FOUND`, `ACTIVITY_NOT_FOUND`, `UNABLE_TO_CREATE_WIDGET`, `INTEGRATION_NOT_FOUND`, `PROJECT_NOT_CONFIGURED`, `SERVER_SETTINGS_NOT_FOUND`, `ISSUE_TYPE_NOT_FOUND`, `PROJECT_SETTINGS_NOT_FOUND`, `TICKET_NOT_FOUND`, `AUTH_INTEGRATION_NOT_FOUND`, `WIDGET_NOT_FOUND_IN_PROJECT`, `USER_FILTER_NOT_FOUND_IN_PROJECT`, `DASHBOARD_NOT_FOUND_IN_PROJECT`, `PATTERN_TEMPLATE_NOT_FOUND_IN_PROJECT`, `TEST_ITEM_OR_LAUNCH_NOT_FOUND`, `ANALYZER_NOT_FOUND`, `ATTACHMENT_NOT_FOUND`, `UNABLE_TO_LOAD_BINARY_DATA`, `CLUSTER_NOT_FOUND`, `ORGANIZATION_NOT_FOUND`, `NOT_FOUND`, `INCORRECT_FILTER_PARAMETERS`, `INCORRECT_SORTING_PARAMETERS`, `INCORRECT_INTEGRATION_NAME`, `UNABLE_MODIFY_SHARABLE_RESOURCE`, `INCORRECT_AUTHENTICATION_TYPE`, `UNABLE_POST_TICKET`, `UNABLE_INTERACT_WITH_INTEGRATION`, `UNABLE_ASSIGN_UNASSIGN_USER_TO_PROJECT`, `EMAIL_CONFIGURATION_IS_INCORRECT`, `PROJECT_UPDATE_NOT_ALLOWED`, `UNABLE_TO_UPDATE_YOURSELF_ROLE`, `FORBIDDEN_OPERATION`, `RESOURCE_ALREADY_EXISTS`, `ROLE_ALREADY_EXISTS_ERROR`, `USER_ALREADY_EXISTS`, `USER_FILTER_ALREADY_EXISTS`, `PROJECT_ALREADY_EXISTS`, `DASHBOARD_UPDATE_ERROR`, `UNABLE_LOAD_WIDGET_CONTENT`, `UNABLE_ADD_TO_FAVORITE`, `INTEGRATION_ALREADY_EXISTS`, `SERVER_SETTINGS_ALREADY_EXISTS`, `UNABLE_REMOVE_FROM_FAVORITE`, `LAUNCH_IS_NOT_FINISHED`, `TEST_ITEM_IS_NOT_FINISHED`, `INCORRECT_FINISH_STATUS`, `BAD_REQUEST_ERROR`, `BAD_SAVE_LOG_REQUEST`, `REPORTING_ITEM_ALREADY_FINISHED`, `AMBIGUOUS_TEST_ITEM_STATUS`, `FAILED_TEST_ITEM_ISSUE_TYPE_DEFINITION`, `FINISH_TIME_EARLIER_THAN_START_TIME`, `FINISH_ITEM_NOT_ALLOWED`, `FINISH_LAUNCH_NOT_ALLOWED`, `START_ITEM_NOT_ALLOWED`, `CHILD_START_TIME_EARLIER_THAN_PARENT`, `UNSUPPORTED_TEST_ITEM_TYPE`, `LOGGING_IS_NOT_ALLOWED`, `BAD_SAVE_WIDGET_REQUEST`, `BAD_UPDATE_WIDGET_REQUEST`, `UNABLE_LOAD_TEST_ITEM_HISTORY`, `BAD_SAVE_USER_FILTER_REQUEST`, `RETRIES_HANDLER_ERROR`, `IMPORT_FILE_ERROR`, `PARSING_XML_ERROR`, `OBJECT_RETRIEVAL_ERROR`, `PLUGIN_UPLOAD_ERROR`, `PLUGIN_REMOVE_ERROR`, `UNABLE_TO_SAVE_CHILD_ITEM_FOR_THE_RETRY`, `PATTERN_ANALYSIS_ERROR`, `PROJECT_DOESNT_CONTAIN_USER`, `UNCLASSIFIED_REPORT_PORTAL_ERROR`, `BAD_UPDATE_PREFERENCE_REQUEST`, `UNSUPPORTED_MERGE_STRATEGY_TYPE`, `DEMO_DATA_GENERATION_ERROR`, `UNCLASSIFIED_ERROR`. - **message** (string) - A human-readable error message. - **stackTrace** (string) - The stack trace of the error, useful for debugging. #### Response Example (400 Bad Request) ```json { "errorCode": "INCORRECT_REQUEST", "message": "string", "stackTrace": "string" } ``` #### Internal Server Error (500) - **message** (string) - A generic error message for server-side issues. - **stackTrace** (string) - The stack trace of the error. * application/json * Schema **errorCode** string * Example (auto) ```json { "errorCode": "INCORRECT_REQUEST", "message": "string", "stackTrace": "string" } ``` ``` -------------------------------- ### C# HttpClient Example for Onboarding API Source: https://developers.reportportal.io/api-docs/service-api/on-boarding Demonstrates how to make a GET request to the onboarding API using HttpClient in C#. Ensure you replace `` with your actual bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/onboarding"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Merge Launches C# Example Source: https://developers.reportportal.io/api-docs/service-api/merge-launches-old-uuid-1 Demonstrates how to merge launches using the HttpClient in C#. Ensure you replace `` with your actual Bearer token and provide the correct projectName. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v1/:projectName/launch/merge"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"name\": \"string\",\n \"description\": \"string\",\n \"attributes\": [\n {\n \"key\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"startTime\": \"2024-07-29T15:51:28.071Z\",\n \"mode\": \"DEFAULT\",\n \"launches\": [\n 0\n ],\n \"endTime\": \"2024-07-29T15:51:28.071Z\",\n \"mergeType\": \"BASIC, DEEP\",\n \"extendSuitesDescription\": true\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Project Group by ID - Request Example Source: https://developers.reportportal.io/api-docs/api-design/get-project-group-by-id This C# example demonstrates how to make a GET request to retrieve a project group by its ID. Ensure you replace placeholder values with your actual project name, group ID, and Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://demo.reportportal.io/api/projects/:project_name/groups/:group_id"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Groups API Request in C# Source: https://developers.reportportal.io/api-docs/api-design/get-groups Example of how to make a GET request to the Get Groups API using HttpClient in C#. Ensure to replace with your actual authorization token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://demo.reportportal.io/api/groups"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Project Launches Source: https://developers.reportportal.io/api-docs/service-api/get-project-launches Example using C# HttpClient to fetch project launches. This code sets up the request, adds necessary headers, sends the request, and processes the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/:projectName/launch"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://developers.reportportal.io/api-docs/service-api/get-launch-by-uuid-old-timestamp Demonstrates how to make a GET request to retrieve launch details using HttpClient in C#. Ensure the Authorization header is correctly set with your Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/:projectName/launch/uuid/:launchId"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://developers.reportportal.io/api-docs/service-uat/user-2 Example of how to call the Get User Details endpoint using HttpClient in C#. Ensure you replace with your actual JWT. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/uat/sso/me"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Groups API Response Example Source: https://developers.reportportal.io/api-docs/api-design/get-groups Example of a successful JSON response when retrieving groups. Includes pagination details and a list of group items. ```json { "offset": 0, "limit": 300, "total_count": 0, "sort": "string", "order": "ASC", "items": [ { "id": 0, "uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "string", "slug": "string", "created_by": 0, "created_at": "2024-07-29T15:51:28.071Z", "updated_at": "2024-07-29T15:51:28.071Z", "stats": { "users_count": 0, "projects_count": 0 } } ] } ``` -------------------------------- ### HTTP Client Example (C#) Source: https://developers.reportportal.io/api-docs/service-api/find-users Demonstrates how to make a GET request to the /api/users/search endpoint using HttpClient in C#. Ensure you replace \'\' with your actual Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/users/search"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Get Group Projects Source: https://developers.reportportal.io/api-docs/api-design/get-group-projects This C# code snippet demonstrates how to use HttpClient to make a GET request to the Get Group Projects API endpoint. Ensure you replace `` with your actual bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://demo.reportportal.io/api/groups/:group_id/projects"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Partial Launch Update Source: https://developers.reportportal.io/api-docs/api-design/partial-launch-update-by-id Demonstrates how to use HttpClient in C# to send a PATCH request for a partial launch update. Ensure to replace `` with your actual authorization token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Patch, "https://demo.reportportal.io/api/launches/:launch_id"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("[ { "op": "add", "path": "string" } ]", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Launch Report Source: https://developers.reportportal.io/api-docs/service-api/get-launch-report Demonstrates how to use HttpClient in C# to fetch a launch report. Ensure you replace `` with your actual JWT token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/:projectName/launch/:launchId/report"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example JSON Response for Get Group Projects Source: https://developers.reportportal.io/api-docs/api-design/get-group-projects This is an example of a successful JSON response when retrieving projects for a group. It includes pagination details and a list of projects with their properties. ```json { "offset": 0, "limit": 300, "total_count": 0, "sort": "string", "order": "ASC", "items": [ { "id": 0, "name": "string", "permission": "MEMBER", "added_at": "2024-07-29T15:51:28.071Z", "updated_at": "2024-07-29T15:51:28.071Z" } ] } ``` -------------------------------- ### C# HttpClient Example Source: https://developers.reportportal.io/api-docs/service-api/get-set-of-integration-system-fields-1 Demonstrates how to make a GET request to retrieve integration system fields using HttpClient in C#. Ensure the Authorization header is correctly set with a valid Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/bts/:integrationId/fields-set"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Widget Request in C# Source: https://developers.reportportal.io/api-docs/service-api/get-widget-1 Example of making a GET request to the widget API using HttpClient in C#. Ensure to replace `` with your actual bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/:projectName/widget/multilevel/:widgetId"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Making a GET Request with Authorization in C# Source: https://developers.reportportal.io/api-docs/service-api/get-user-bid-info Example of how to make a GET request to the /api/users/registration endpoint using HttpClient in C#. Ensure to replace with your actual JWT. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/users/registration"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Start Launch Source: https://developers.reportportal.io/api-docs/service-api/launch-async Starts a launch for a specified project. ```APIDOC ## POST /launch ### Description Starts a launch for a specified project. ### Method POST ### Endpoint /launch ``` -------------------------------- ### Get User Details Request (C#) Source: https://developers.reportportal.io/api-docs/service-uat/user Example of how to make a GET request to the /uat/sso/user endpoint using HttpClient in C#. This code handles sending the request and processing the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/uat/sso/user"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get All Users Request (C#) Source: https://developers.reportportal.io/api-docs/service-api/get-users Example of how to make a GET request to retrieve all users using HttpClient in C#. Ensure the Authorization header is correctly set with a Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/users/all"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Project Widget (C#) Source: https://developers.reportportal.io/api-docs/service-api/get-project-widget Example of how to make a GET request to the project widget endpoint using HttpClient in C#. Ensure you replace `` with your actual bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/project/:projectName/widget/:widgetCode"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Create Cluster C# Example Source: https://developers.reportportal.io/api-docs/service-api/create-clusters Demonstrates how to create a cluster using HttpClient in C#. Ensure the Authorization header includes a valid Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v1/:projectName/launch/cluster"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{ \n \"launchId\": 0, \n \"removeNumbers\": true \n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Compare Launches API Request (C#) Source: https://developers.reportportal.io/api-docs/service-api/compare-launches Demonstrates how to make a GET request to compare launches using HttpClient in C#. Ensure the Authorization header is set with a valid Bearer Token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/:projectName/launch/compare"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Items History Response (200 OK) Source: https://developers.reportportal.io/api-docs/service-api/get-items-history Example of a successful response from the Get Items History API. It includes content with detailed item information and pagination details. ```json { "content": [ { "groupingField": "string", "resources": [ { "id": 0, "uuid": "string", "name": "string", "codeRef": "string", "description": "string", "parameters": [ { "key": "string", "value": "string" } ], "attributes": [ { "key": "string", "value": "string" } ], "type": "string", "startTime": "2024-07-29T15:51:28.071Z", "endTime": "2024-07-29T15:51:28.071Z", "status": "string", "statistics": { "executions": {}, "defects": {} }, "parent": 0, "pathNames": { "launchPathName": { "name": "string", "number": 0 }, "itemPaths": [ { "id": 0, "name": "string" } ] }, "launchStatus": "string", "issue": { "issueType": "string", "comment": "string", "autoAnalyzed": true, "ignoreAnalyzer": true, "externalSystemIssues": [ { "ticketId": "string", "submitDate": "2024-07-29T15:51:28.071Z", "btsUrl": "string", "btsProject": "string", "url": "string", "pluginName": "string" } ] }, "hasChildren": true, "hasStats": true, "launchId": 0, "uniqueId": "string", "testCaseId": "string", "testCaseHash": 0, "patternTemplates": [ "string" ], "path": "string", "hasNestedSteps": true, "analysisOwner": "string" } ] } ], "page": { "number": 0, "size": 0, "totalElements": 0, "totalPages": 0, "hasNext": true } } ``` -------------------------------- ### Example Response for Get Suggested Items Source: https://developers.reportportal.io/api-docs/service-api/get-suggested-items This JSON object represents a successful response from the Get Suggested Items API, detailing a test item, its logs, and suggested analysis results. ```json [ { "testItemResource": { "id": 0, "uuid": "string", "name": "string", "codeRef": "string", "description": "string", "parameters": [ { "key": "string", "value": "string" } ], "attributes": [ { "key": "string", "value": "string" } ], "type": "string", "startTime": "2024-07-29T15:51:28.071Z", "endTime": "2024-07-29T15:51:28.071Z", "status": "string", "statistics": { "executions": {}, "defects": {} }, "parent": 0, "pathNames": { "launchPathName": { "name": "string", "number": 0 }, "itemPaths": [ { "id": 0, "name": "string" } ] }, "launchStatus": "string", "issue": { "issueType": "string", "comment": "string", "autoAnalyzed": true, "ignoreAnalyzer": true, "externalSystemIssues": [ { "ticketId": "string", "submitDate": "2024-07-29T15:51:28.071Z", "btsUrl": "string", "btsProject": "string", "url": "string", "pluginName": "string" } ] }, "hasChildren": true, "hasStats": true, "launchId": 0, "uniqueId": "string", "testCaseId": "string", "testCaseHash": 0, "patternTemplates": [ "string" ], "path": "string", "hasNestedSteps": true, "analysisOwner": "string" }, "logs": [ { "id": 0, "uuid": "string", "time": "2024-07-29T15:51:28.071Z", "message": "string", "binaryContent": { "id": "string", "thumbnailId": "string", "contentType": "string" }, "thumbnail": "string", "level": "string", "itemId": 0, "launchId": 0 } ], "suggestRs": { "project": 0, "testItem": 0, "testItemLogId": 0, "launchId": 0, "launchName": "string", "launchNumber": 0, "issueType": "string", "relevantItem": 0, "relevantLogId": 0, "isMergedLog": true, ``` -------------------------------- ### Start Root Item (C# HttpClient) Source: https://developers.reportportal.io/api-docs/service-api/start-root-item-2 Use this snippet to start a root item using C# with HttpClient. Ensure you have a valid Bearer token for authorization. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v2/:projectName/item/"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{\n \"startTime\": \"2024-07-29T15:51:28.071Z\",\n \"launchUuid\": \"string\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"attributes\": [\n {\n \"key\": \"string\",\n \"value\": \"string\",\n \"system\": false\n }\n ],\n \"uuid\": \"string\",\n \"codeRef\": \"string\",\n \"parameters\": [\n {\n \"key\": \"string\",\n \"value\": \"string\"\n }\n ],\n \"uniqueId\": \"string\",\n \"testCaseId\": \"string\",\n \"type\": \"SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS, BEFORE_GROUPS,BEFORE_METHOD, BEFORE_SUITE, BEFORE_TEST, AFTER_CLASS, AFTER_GROUPS, AFTER_METHOD, AFTER_SUITE, AFTER_TEST\",\n \"retry\": true,\n \"hasStats\": true,\n \"retryOf\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Project Request in C# Source: https://developers.reportportal.io/api-docs/service-api/get-project Example of how to make a GET request to retrieve project details using HttpClient in C#. Ensure the Authorization header is correctly set with a Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/project/:projectName"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get All Projects Info (C#) Source: https://developers.reportportal.io/api-docs/service-api/get-all-projects-info Demonstrates how to retrieve project information using C# and HttpClient. Ensure the Authorization header is correctly set with a Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "/api/v1/project/list"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Start Launch Source: https://developers.reportportal.io/api-docs/service-api/start-launch-1 Initiates a new launch. Requires project name as a path parameter and launch details in the request body. Supports authentication via Bearer Token. ```APIDOC ## POST /api/v1/:projectName/launch ### Description Starts a new launch in the specified project. ### Method POST ### Endpoint /api/v1/:projectName/launch ### Parameters #### Path Parameters - **projectName** (string) - Required - The name of the project. #### Request Body - **startTime** (string) - Required - The start time of the launch in ISO 8601 format. - **name** (string) - Required - The name of the launch. - **description** (string) - Optional - A description for the launch. - **attributes** (array) - Optional - A list of attributes for the launch. - **key** (string) - Required - The attribute key. - **value** (string) - Required - The attribute value. - **system** (boolean) - Optional - Indicates if the attribute is system-defined. - **uuid** (string) - Optional - A unique identifier for the launch. - **mode** (string) - Optional - The mode of the launch (e.g., DEFAULT, DEBUG, RESUME). - **rerun** (boolean) - Optional - Indicates if this launch is a rerun. - **rerunOf** (string) - Optional - The UUID of the launch being rerun. ### Request Example ```json { "startTime": "2024-07-29T15:51:28.071Z", "name": "string", "description": "string", "attributes": [ { "key": "string", "value": "string", "system": false } ], "uuid": "string", "mode": "DEFAULT", "rerun": true, "rerunOf": "string" } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the created launch. - **uuid** (string) - The UUID of the created launch. - **startTime** (string) - The start time of the launch. - **name** (string) - The name of the launch. - **description** (string) - The description of the launch. - **attributes** (array) - The attributes of the launch. - **mode** (string) - The mode of the launch. - **launchStatus** (string) - The status of the launch. - **number** (integer) - The launch number. - **owner** (string) - The owner of the launch. - **lastModified** (string) - The last modified timestamp. - **hasRetries** (boolean) - Indicates if the launch has retries. - **statistics** (object) - Statistics for the launch. #### Response Example ```json { "id": 0, "uuid": "string", "startTime": "2024-07-29T15:51:28.071Z", "name": "string", "description": "string", "attributes": [ { "key": "string", "value": "string", "system": false } ], "mode": "DEFAULT", "launchStatus": "IN_PROGRESS", "number": 0, "owner": "string", "lastModified": "2024-07-29T15:51:28.071Z", "hasRetries": true, "statistics": {} } ``` ``` -------------------------------- ### Create Dashboard C# Example Source: https://developers.reportportal.io/api-docs/service-api/create-dashboard Example of creating a dashboard using HttpClient in C#. Ensure the Authorization header is set with a valid Bearer token. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "/api/v1/:projectName/dashboard"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{ \n \"description\": \"string\",\n \"name\": \"string\"\n}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example for Plugin Command Source: https://developers.reportportal.io/api-docs/service-api/execute-plugin-command Demonstrates how to execute a plugin command using C# HttpClient. Ensure the Authorization header includes a valid Bearer token and the request body is correctly formatted. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Put, "/api/v1/plugin/:projectName/:pluginName/common/:command"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Bearer "); var content = new StringContent("{}", null, "application/json"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ```