GET /Job/GetJobRunsForJob/{id}/

Gets the job runs associated with the given job ID.
 

Request

Method Request URI
GET /API/Job/GetJobRunsForJob/{id}/?sessionId=value

URI Parameters

URI Parameter Description
sessionId Current session ID.

Path Parameters

Path Parameter Description
id The job ID that the job runs are associated with.

Request Body

There is no Request Body for this function.

Response

Response Body

An array of Dundas.BI.WebApi.Models.JobRunData objects, or a status code indicating the problem.

Examples

This example will login and get the job runs for the job with ID = 5db1083b-9beb-4c83-a56e-882596b05bb3.

C# Java JavaScript
using System.Net;
using System.Net.Http;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Web.Script.Serialization;

   ...

using (HttpClient httpClient = new HttpClient())
{
	// Get Session Id
	string logonUri = "http://localhost:8004/Api/LogOn/";
	var logonOptions = new
	{
		accountName = "admin",
		password = "1234",
		cultureName = string.Empty,
		deleteOtherSessions = true,
		isWindowsLogOn = false
	};

	JavaScriptSerializer serializer = new JavaScriptSerializer();
	var requestBodyAsString = serializer.Serialize(logonOptions);
	StringContent content =
		new StringContent(
			requestBodyAsString,
			Encoding.UTF8,
			"application/json"
		);

	string jsonString = string.Empty;

	using (var response = httpClient.PostAsync(logonUri, content).Result)
	{
		jsonString =
			response.Content.ReadAsStringAsync().Result;
	}

	var obj = (Dictionary<string,object>) serializer.DeserializeObject(jsonString);
	string sessionId = obj["sessionId"].ToString();
	string url = "http://localhost:8004/API/Job/GetJobRunsForJob/5db1083b-9beb-4c83-a56e-882596b05bb3/?sessionId=" + sessionId + "";

	using (var response = httpClient.GetAsync(url).Result)
	{
		if(response.StatusCode == HttpStatusCode.OK)
		{
			Console.WriteLine("Success");

			// An array of Dundas.BI.WebApi.Models
			// JobRunData objects as a JSON string.
			string jsonObject = response.Content.ReadAsStringAsync().Result;
		}
	}
}

		
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.apache.http.entity.StringEntity;
import org.json.JSONObject;

   ...

HttpClient httpClient = HttpClientBuilder.create().build();

String url = "http://localhost:8004";

// Get Session Id
String logonUri = url + "Api/LogOn/"
HttpPost httpPost = new HttpPost(logonUri);
StringEntity stringEntity = 
	new StringEntity("{
		+ "\"accountName\":\"admin\","
		+ "\"password":\"1234\","
		+ "\"cultureName\":\"\","
		+ "\"deleteOtherSessions\":false,"
		+ "\"isWindowsLogOn\":false"
		+ "}"
	);
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
HttpResponse httpResponse = httpClient.execute(httpPost);
String jsonString = EntityUtils.toString(httpResponse.getEntity());
JSONObject jsonObj = new JSONObject(jsonString);
String sessionId = jsonObj.getString("sessionId")

String requestUrl = "http://localhost:8004/API/Job/GetJobRunsForJob/5db1083b-9beb-4c83-a56e-882596b05bb3/?sessionId=" + sessionId + "";

// Define the Request Method.
HttpGet requstMethod = new HttpGet(requestUrl);

HttpResponse response = 
	httpClient.execute(requstMethod);

if(response.getStatusLine().getStatusCode() == 200)
{
	System.out.println("Success");
}
// An array of Dundas.BI.WebApi.Models
// JobRunData objects as a JSON string.
String json = EntityUtils.toString(response.getEntity());
		
var baseUrl = 'http://localhost:8005';
var logonOptions =
{
	accountName: 'admin',
	password: '1234',
	cultureName: 'en-us',
	deleteOtherSessions: false,
	isWindowsLogOn: false
};
$.ajax({
	type: 'POST',
	url: baseUrl + '/Api/LogOn/',
	data: logonOptions,
	success: function(logOnResultData) { 
		var sessionId = logOnResultData.sessionId; 
		$.ajax({
			type: "GET",
			url: baseUrl + "/API/Job/GetJobRunsForJob/5db1083b-9beb-4c83-a56e-882596b05bb3/?sessionId=" + sessionId + "",
			success: function(data) { 
				 // data = An array of Dundas.BI.WebApi
				 // Models.JobRunData objects.

			},
			error: function(data) { alert('failed' + data); }
		});
	}
});