Update ExportDestination - m3ter Documentation
Update ExportDestination
cURL
curl --request PUT \
--url https://api.m3ter.com/organizations/{orgId}/dataexports/destinations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"bucketName": "<string>",
"iamRoleArn": "<string>",
"version": 123,
"prefix": "<string>",
"partitionOrder": "<unknown>"
}
'
Python
import requests
url = "https://api.m3ter.com/organizations/{orgId}/dataexports/destinations/{id}"
payload = {
"name": "<string>",
"code": "<string>",
"bucketName": "<string>",
"iamRoleArn": "<string>",
"version": 123,
"prefix": "<string>",
"partitionOrder": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)
JavaScript (Fetch API)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
bucketName: '<string>',
iamRoleArn: '<string>',
version: 123,
prefix: '<string>',
partitionOrder: '<unknown>'
})
};
fetch('https://api.m3ter.com/organizations/{orgId}/dataexports/destinations/{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/destinations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'code' => '<string>',
'bucketName' => '<string>',
'iamRoleArn' => '<string>',
'version' => 123,
'prefix' => '<string>',
'partitionOrder' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.m3ter.com/organizations/{orgId}/dataexports/destinations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"bucketName\": \"<string>\",\n \"iamRoleArn\": \"<string>\",\n \"version\": 123,\n \"prefix\": \"<string>\",\n \"partitionOrder\": \"<unknown>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Unirest (Java)
HttpResponse<String> response = Unirest.put("https://api.m3ter.com/organizations/{orgId}/dataexports/destinations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"bucketName\": \"<string>\",\n \"iamRoleArn\": \"<string>\",\n \"version\": 123,\n \"prefix\": \"<string>\",\n \"partitionOrder\": \"<unknown>\"\n}")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://api.m3ter.com/organizations/{orgId}/dataexports/destinations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"bucketName\": \"<string>\",\n \"iamRoleArn\": \"<string>\",\n \"version\": 123,\n \"prefix\": \"<string>\",\n \"partitionOrder\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body
Response Structure
200
{
"id": "<string>",
"version": 123,
"name": "<string>",
"code": "<string>",
"dtCreated": "2023-11-07T05:31:56Z",
"dtLastModified": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedBy": "<string>",
"bucketName": "<string>",
"prefix": "<string>",
"iamRoleArn": "<string>",
"partitionOrder": "<unknown>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
Authorizations
Authorization
- Type: string
- Location: header
- Required: Yes
- Description: 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 Export Destination to update.
Body Parameters
- name: string, required, The name of the Export Destination. Required string length:
1 - 200 - code: string, required, The code of the Export Destination. Required string length:
1 - 80 - bucketName: string, required, Name of the S3 bucket for the Export Destination. Required string length:
3 - 63 - iamRoleArn: string, required, To enable m3ter to upload a Data Exports to your S3 bucket.
- version: integer
, The version number of the entity. - prefix: string, Location in specified S3 bucket for the Export Destination. If you omit a
prefix, then the root of the bucket will be used. - partitionOrder: any
Response Parameters
200
- id: string, required, The UUID of the entity.
- version: integer
, The version number. - name: string, The name of the data Export Destination.
- code: string, The code of the data Export Destination.
- dtCreated: string
, The DateTime when the Export Destination was created. - dtLastModified: string
, The DateTime when the Export Destination was last modified. - createdBy: string, The id of the user who created the Export Destination.
- lastModifiedBy: string, The id of the user who last modified the Export Destination.
- bucketName: string, Name of the S3 bucket for the Export Destination.
- prefix: string, Location in specified S3 bucket for the Export Destination.
- iamRoleArn: string, The specified IAM role ARN.