Post Source
curl --request POST \
--url https://api.sandbox.isometric.com/mrv/v0/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-client-secret: <x-client-secret>' \
--data '
{
"__typename": "CreateDocumentSourceRequest",
"content_length": 123,
"content_type": "<string>",
"display_name": "<string>",
"file_name": "<string>",
"project_id": "prj_1CTWZQGKE1S0VAXA",
"published_at": "2023-12-25",
"supplier_reference_id": "<string>",
"description": "<string>",
"is_public": false
}
'import requests
url = "https://api.sandbox.isometric.com/mrv/v0/sources"
payload = {
"__typename": "CreateDocumentSourceRequest",
"content_length": 123,
"content_type": "<string>",
"display_name": "<string>",
"file_name": "<string>",
"project_id": "prj_1CTWZQGKE1S0VAXA",
"published_at": "2023-12-25",
"supplier_reference_id": "<string>",
"description": "<string>",
"is_public": False
}
headers = {
"x-client-secret": "<x-client-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-secret': '<x-client-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
__typename: 'CreateDocumentSourceRequest',
content_length: 123,
content_type: '<string>',
display_name: '<string>',
file_name: '<string>',
project_id: 'prj_1CTWZQGKE1S0VAXA',
published_at: '2023-12-25',
supplier_reference_id: '<string>',
description: '<string>',
is_public: false
})
};
fetch('https://api.sandbox.isometric.com/mrv/v0/sources', 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.sandbox.isometric.com/mrv/v0/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'__typename' => 'CreateDocumentSourceRequest',
'content_length' => 123,
'content_type' => '<string>',
'display_name' => '<string>',
'file_name' => '<string>',
'project_id' => 'prj_1CTWZQGKE1S0VAXA',
'published_at' => '2023-12-25',
'supplier_reference_id' => '<string>',
'description' => '<string>',
'is_public' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-client-secret: <x-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.isometric.com/mrv/v0/sources"
payload := strings.NewReader("{\n \"__typename\": \"CreateDocumentSourceRequest\",\n \"content_length\": 123,\n \"content_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"file_name\": \"<string>\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"published_at\": \"2023-12-25\",\n \"supplier_reference_id\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-secret", "<x-client-secret>")
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))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.isometric.com/mrv/v0/sources")
.header("x-client-secret", "<x-client-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"__typename\": \"CreateDocumentSourceRequest\",\n \"content_length\": 123,\n \"content_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"file_name\": \"<string>\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"published_at\": \"2023-12-25\",\n \"supplier_reference_id\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.isometric.com/mrv/v0/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-secret"] = '<x-client-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"__typename\": \"CreateDocumentSourceRequest\",\n \"content_length\": 123,\n \"content_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"file_name\": \"<string>\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"published_at\": \"2023-12-25\",\n \"supplier_reference_id\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": false\n}"
response = http.request(request)
puts response.read_body{
"signed_upload_url": "<string>",
"source": {
"description": "<string>",
"display_name": "<string>",
"id": "src_1EBBF4M7X1S06G1Y",
"is_public": true,
"original_filename": "<string>",
"project_id": "prj_1CTWZQGKE1S0VAXA",
"published_at": "2023-12-25",
"supplier_reference_id": "<string>",
"type": "DOCUMENT",
"url_info": {
"url": "<string>",
"__typename": "SourcePublicUrlInfo"
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Sources
Post Source
Creates a source in the Isometric system. The client is provided with a presigned upload URL which must be used to upload the document associated with this source. Source documents are private, but other fields will be visible publicly once credits are issued for an associated removal, moving it to the public registry.
POST
/
sources
Post Source
curl --request POST \
--url https://api.sandbox.isometric.com/mrv/v0/sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-client-secret: <x-client-secret>' \
--data '
{
"__typename": "CreateDocumentSourceRequest",
"content_length": 123,
"content_type": "<string>",
"display_name": "<string>",
"file_name": "<string>",
"project_id": "prj_1CTWZQGKE1S0VAXA",
"published_at": "2023-12-25",
"supplier_reference_id": "<string>",
"description": "<string>",
"is_public": false
}
'import requests
url = "https://api.sandbox.isometric.com/mrv/v0/sources"
payload = {
"__typename": "CreateDocumentSourceRequest",
"content_length": 123,
"content_type": "<string>",
"display_name": "<string>",
"file_name": "<string>",
"project_id": "prj_1CTWZQGKE1S0VAXA",
"published_at": "2023-12-25",
"supplier_reference_id": "<string>",
"description": "<string>",
"is_public": False
}
headers = {
"x-client-secret": "<x-client-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-secret': '<x-client-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
__typename: 'CreateDocumentSourceRequest',
content_length: 123,
content_type: '<string>',
display_name: '<string>',
file_name: '<string>',
project_id: 'prj_1CTWZQGKE1S0VAXA',
published_at: '2023-12-25',
supplier_reference_id: '<string>',
description: '<string>',
is_public: false
})
};
fetch('https://api.sandbox.isometric.com/mrv/v0/sources', 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.sandbox.isometric.com/mrv/v0/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'__typename' => 'CreateDocumentSourceRequest',
'content_length' => 123,
'content_type' => '<string>',
'display_name' => '<string>',
'file_name' => '<string>',
'project_id' => 'prj_1CTWZQGKE1S0VAXA',
'published_at' => '2023-12-25',
'supplier_reference_id' => '<string>',
'description' => '<string>',
'is_public' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-client-secret: <x-client-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.isometric.com/mrv/v0/sources"
payload := strings.NewReader("{\n \"__typename\": \"CreateDocumentSourceRequest\",\n \"content_length\": 123,\n \"content_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"file_name\": \"<string>\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"published_at\": \"2023-12-25\",\n \"supplier_reference_id\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-secret", "<x-client-secret>")
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))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.isometric.com/mrv/v0/sources")
.header("x-client-secret", "<x-client-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"__typename\": \"CreateDocumentSourceRequest\",\n \"content_length\": 123,\n \"content_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"file_name\": \"<string>\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"published_at\": \"2023-12-25\",\n \"supplier_reference_id\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.isometric.com/mrv/v0/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-secret"] = '<x-client-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"__typename\": \"CreateDocumentSourceRequest\",\n \"content_length\": 123,\n \"content_type\": \"<string>\",\n \"display_name\": \"<string>\",\n \"file_name\": \"<string>\",\n \"project_id\": \"prj_1CTWZQGKE1S0VAXA\",\n \"published_at\": \"2023-12-25\",\n \"supplier_reference_id\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": false\n}"
response = http.request(request)
puts response.read_body{
"signed_upload_url": "<string>",
"source": {
"description": "<string>",
"display_name": "<string>",
"id": "src_1EBBF4M7X1S06G1Y",
"is_public": true,
"original_filename": "<string>",
"project_id": "prj_1CTWZQGKE1S0VAXA",
"published_at": "2023-12-25",
"supplier_reference_id": "<string>",
"type": "DOCUMENT",
"url_info": {
"url": "<string>",
"__typename": "SourcePublicUrlInfo"
}
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Headers
Body
application/json
The content type of the file that will be uploaded. This must also be passed as a Content-Type header during the upload. The pre-signed URL will only accept a file of this content-type. See the list of supported filetypes.
Was this page helpful?