This page provides examples and guidance for checking the status of asynchronous jobs in Norce Commerce Connect. Use these examples to monitor import progress, troubleshoot issues, and integrate job status checks into your workflows.
Norce Commerce Connect processes many operations asynchronously. When you submit an import or update, the API returns a job ID. You can use this job ID to check the status of your request, retrieve job details, or restart jobs if needed.
- Norce Commerce Connect Job Examples (Postman Collection)
- .NET code examples using the official NuGet package (see below)
Norce Commerce provides official client libraries for C#. These libraries simplify integration with the Connect API.
Use the Job/Get
endpoint to retrieve information about a specific job by its job ID. The response includes a StatusId
field, which indicates the job's current state:
1
= Initialized2
= Succeeded3
= Failed4
= Validation failed
Click to expand .NET code example
// filepath: c:\Data\GitHub\docs.norce.io\developer-portal\system-integration\job-check-examples.md
// Using Storm Client library: https://github.com/StormCommerce/Storm.Connect.Contracts
// NuGet: https://www.nuget.org/packages/Enferno.Services.StormConnect.Contracts/
private static void Main()
{
var serviceUrl = "https://demo.api-se.norce.tech/commerce/connect/4.0/";
var applicationId = 0;
var secretKey = Guid.NewGuid();
// List details for specific job
var job = ImportMethod(serviceUrl, applicationId, secretKey);
// Recheck specific job to see updated status
var specificJob = GetJob(serviceUrl, applicationId, secretKey, job.JobId);
// List all jobs
var allJobs = GetJobs(serviceUrl, applicationId, secretKey);
}
public static JobDto GetJob(
string serviceUrl, int applicationId, Guid secretKey, int jobId)
{
using (var httpClient = new HttpClient())
{
var credentials =
Encoding.ASCII.GetBytes($"{applicationId}:{secretKey.ToString("D")}");
// Base64Encoded Basic authentication is used
var credentialsToBase64 = Convert.ToBase64String(credentials);
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Basic", credentialsToBase64);
var jobResponse = httpClient.GetStringAsync($"{serviceUrl}job/{jobId}").Result;
return JsonConvert.DeserializeObject<JobDto>(jobResponse);
}
}
public static List<JobDto> GetJobs(
string serviceUrl, int applicationId, Guid secretKey)
{
using (var httpClient = new HttpClient())
{
var credentials =
Encoding.ASCII.GetBytes($"{applicationId}:{secretKey.ToString("D")}");
// Base64Encoded Basic authentication is used
var credentialsToBase64 = Convert.ToBase64String(credentials);
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Basic", credentialsToBase64);
var allJobsResponse = httpClient.GetStringAsync($"{serviceUrl}job").Result;
return JsonConvert.DeserializeObject<List<JobDto>>(allJobsResponse);
}
}
Use the Job/List
endpoint to retrieve all jobs run since the last log cleanup.
Use the Job/Restart
endpoint to rerun a job using the original payload. This is mainly used for debugging or retrying failed jobs.
Use the Job/Ping
endpoint to check the uptime status of the Norce Commerce Connect service.
Explore additional code examples and integration scenarios: