Create an Artifact
curl --request POST \
--url https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts \
--header 'Authorization: Bearer <token>' \
--header 'content-type: multipart/form-data' \
--header 'environmentName: <environmentname>' \
--header 'versionName: <versionname>' \
--form filename-including-path='@example-file'import requests
url = "https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts"
files = { "filename-including-path": ("example-file", open("example-file", "rb")) }
headers = {
"versionName": "<versionname>",
"environmentName": "<environmentname>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('filename-including-path', '<string>');
const options = {
method: 'POST',
headers: {
versionName: '<versionname>',
environmentName: '<environmentname>',
Authorization: 'Bearer <token>'
}
};
options.body = form;
fetch('https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts', 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://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filename-including-path\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"content-type: multipart/form-data",
"environmentName: <environmentname>",
"versionName: <versionname>"
],
]);
$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://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filename-including-path\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("versionName", "<versionname>")
req.Header.Add("environmentName", "<environmentname>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts")
.header("versionName", "<versionname>")
.header("environmentName", "<environmentname>")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filename-including-path\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["versionName"] = '<versionname>'
request["environmentName"] = '<environmentname>'
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filename-including-path\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"ignoredResources": [
{
"name": "<string>",
"reason": "<string>"
}
],
"versionName": "1"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}Artifacts
Create an Artifact
An endpoint to create an artifact
POST
/
v1
/
projects
/
{projectId}
/
artifacts
Create an Artifact
curl --request POST \
--url https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts \
--header 'Authorization: Bearer <token>' \
--header 'content-type: multipart/form-data' \
--header 'environmentName: <environmentname>' \
--header 'versionName: <versionname>' \
--form filename-including-path='@example-file'import requests
url = "https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts"
files = { "filename-including-path": ("example-file", open("example-file", "rb")) }
headers = {
"versionName": "<versionname>",
"environmentName": "<environmentname>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('filename-including-path', '<string>');
const options = {
method: 'POST',
headers: {
versionName: '<versionname>',
environmentName: '<environmentname>',
Authorization: 'Bearer <token>'
}
};
options.body = form;
fetch('https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts', 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://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filename-including-path\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"content-type: multipart/form-data",
"environmentName: <environmentname>",
"versionName: <versionname>"
],
]);
$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://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filename-including-path\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("versionName", "<versionname>")
req.Header.Add("environmentName", "<environmentname>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts")
.header("versionName", "<versionname>")
.header("environmentName", "<environmentname>")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filename-including-path\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://eu1.api.matillion.com/dpc/v1/projects/{projectId}/artifacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["versionName"] = '<versionname>'
request["environmentName"] = '<environmentname>'
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filename-including-path\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"ignoredResources": [
{
"name": "<string>",
"reason": "<string>"
}
],
"versionName": "1"
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}{
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"violations": [
"<string>"
]
}Authorizations
a valid bearer token
Headers
Path Parameters
Body
multipart/form-data
To create an artifact a MultiPart form data body is required.
The request should contain all the assets(files) within your Data Productivity Cloud project.
Each asset will need to set the multipart name as the full relative path of the asset including the asset name. Each asset will also require a text/plain content type header to be set. Currently only text files are supported.
Was this page helpful?
⌘I
