Get job by ID
curl --request GET \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId} \
--header 'Authorization: <api-key>'import requests
url = "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"job": {
"id": "8e2f3641-5f0a-45a2-9d1b-39cf16b2d0e7",
"jobType": "multi-import",
"status": "COMPLETE",
"started": "2024-09-05T10:20:46.143759190Z",
"finished": "2024-09-05T10:21:02.200386224Z",
"elapsed": "PT16.056627034S",
"links": {
"self": "/v1/mock-apis/0ozge/jobs/8e2f3641-5f0a-45a2-9d1b-39cf16b2d0e7"
},
"outcome": {
"mappings": [
{
"id": "7e6d6733-881e-416d-9f6c-bad8d5015d0f"
},
{
"id": "2791b6fe-bbbe-4102-a3fd-721fb9ba1557"
}
]
}
}
}Jobs
Get job by ID
Check the status and outcome of a background job, such as an import (job type multi-import) or an OpenAPI Git pull or push.
Poll this endpoint - e.g. using the URL returned in the job’s links.self - until the job’s status is COMPLETE or ERROR,
at which point its outcome field will contain the job’s result (for imports, the IDs of the created stub mappings) or errors respectively.
GET
/
v1
/
mock-apis
/
{mockApiId}
/
jobs
/
{jobId}
Get job by ID
curl --request GET \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId} \
--header 'Authorization: <api-key>'import requests
url = "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/jobs/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"job": {
"id": "8e2f3641-5f0a-45a2-9d1b-39cf16b2d0e7",
"jobType": "multi-import",
"status": "COMPLETE",
"started": "2024-09-05T10:20:46.143759190Z",
"finished": "2024-09-05T10:21:02.200386224Z",
"elapsed": "PT16.056627034S",
"links": {
"self": "/v1/mock-apis/0ozge/jobs/8e2f3641-5f0a-45a2-9d1b-39cf16b2d0e7"
},
"outcome": {
"mappings": [
{
"id": "7e6d6733-881e-416d-9f6c-bad8d5015d0f"
},
{
"id": "2791b6fe-bbbe-4102-a3fd-721fb9ba1557"
}
]
}
}
}Authorizations
Your API key prefixed by 'Token '