Retrieve Job - m3ter Documentation
Retrieve Job
cURL
curl --request GET \
--url https://api.m3ter.com/organizations/{orgId}/dataexports/jobs/{id} \
--header 'Authorization: Bearer <token>'
Python
import requests
url = "https://api.m3ter.com/organizations/{orgId}/dataexports/jobs/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch API)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.m3ter.com/organizations/{orgId}/dataexports/jobs/{id}', 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://api.m3ter.com/organizations/{orgId}/dataexports/jobs/{id}",\
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: Bearer <token>"\
],\
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.m3ter.com/organizations/{orgId}/dataexports/jobs/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Java (Unirest)
HttpResponse<String> response = Unirest.get("https://api.m3ter.com/organizations/{orgId}/dataexports/jobs/{id}")
.header("Authorization", "Bearer <token>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://api.m3ter.com/organizations/{orgId}/dataexports/jobs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
Response Codes
- 200: Successful retrieval of the export job.
- 4XX: Client error.
- 5XX: Server error.
Example Responses
Successful Response
{
"id": "<string>",
"version": 123,
"scheduleId": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"dateCreated": "2023-11-07T05:31:56Z",
"sourceType": "<unknown>",
"status": "<unknown>"
}
Error Response
{
"message": "<string>"
}
Authorizations
- Authorization: String (header, required) - m3ter supports machine to machine authentication using the
clientCredentialsOAuth2 flow.
Path Parameters
- orgId: String (required) - UUID of the organization.
- id: String (required) - The UUID of the Job to retrieve.
Response Details
200 Response
- Type: application/json
- Returns the requested Export Job.
Response Fields:
- id: String (required) - The id of the Export Job.
- version: Integer (required) - The version number:
- scheduleId: String - The id of the data Export Schedule.
- startedAt: String (date-time) - When the data Export Job started running.
- dateCreated: String (date-time) - When the data Export Job was created.
- sourceType: Any
- status: Any