Hi @Chau_JunYue
Try this code
// The URL of the Orchestrator instance
const string orchestratorUrl = “https://yourinstance.orchestrator.com”;
// The API key or access token for authenticating to the Orchestrator API
const string apiKey = “your-api-key-or-access-token”;
// The ID of the asset credential you want to retrieve
const string assetCredentialId = “your-asset-credential-id”;
// Create an HTTP client for calling the Orchestrator API
var client = new HttpClient();
// Set the base URL for the client
client.BaseAddress = new Uri(orchestratorUrl);
// Set the API key or access token as the Authorization header for the client
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(“Bearer”, apiKey);
// Call the Assets API endpoint to retrieve the asset credential
var response = await client.GetAsync($“/odata/Assets({assetCredentialId})”);
// Handle the API response
if (response.IsSuccessStatusCode)
{
// The asset credential was retrieved successfully
var assetCredential = JObject.Parse(response.Content.ReadAsStringAsync().Result);
}
else
{
// There was an error retrieving the asset credential
}