Skip to main content
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": "<string>",
  "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": "<string>",
"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: '<string>',
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' => '<string>',
'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\": \"<string>\",\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\": \"<string>\",\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\": \"<string>\",\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>",
    "url_info": {
      "url": "<string>",
      "__typename": "SourcePublicUrlInfo"
    }
  }
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}

Authorizations

Authorization
string
header
required

A JWT Bearer token header for authentication and authorization, in the format Authorization: Bearer <token>

Headers

x-client-secret
string
required

A secret token identifying the client connecting to the API

Example:

"Syou3EZiO5vuMEgNyBeA8cjEMYOnQDwP"

Body

application/json
__typename
string
required

Contains the name of the model (formally, OpenAPI Schema Object). Used to determine the type of data, for example when two different types are unioned.

Allowed value: "CreateDocumentSourceRequest"
content_length
integer
required

The size (in bytes) of the file that will be uploaded. The pre-signed URL will only accept a file of this size.

Required range: x <= 50000000
content_type
string
required

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.

display_name
string
required
Required string length: 1 - 150
file_name
string
required

The full name of the file that will be uploaded, including its file extension

project_id
string
required

The ID of the project that the source is associated with.

Required string length: 20 - 37
Examples:

"prj_1CTWZQGKE1S0VAXA"

"prj_1E0QTWB22SBX34D1"

published_at
string<date>
required

Date in ISO format (YYYY-MM-DD)

supplier_reference_id
string
required

A string that must be unique for all resources created by a specific supplier. It can be used by a client to identify the correct objects in their system.

Required string length: 1 - 200
description
string | null

An optional description of the source document.

is_public
boolean
default:false

If the source document should be publicly available on the Registry once credits are issued.

Response

Successful Response

signed_upload_url
string
required

A presigned upload URL, which must be used to upload the document associated with this source.

source
Source · object
required