curl --request POST \
--url https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'file={
"bytes": [
"aSDinaTvuI8gbWludGxpZnk="
],
"contentType": "<string>",
"empty": true,
"inputStream": {},
"name": "<string>",
"originalFilename": "<string>",
"size": 123
}'import requests
url = "https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--"
headers = {
"Authorization": "<api-key>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '{
"bytes": [
"aSDinaTvuI8gbWludGxpZnk="
],
"contentType": "<string>",
"empty": true,
"inputStream": {},
"name": "<string>",
"originalFilename": "<string>",
"size": 123
}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references', 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://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references",
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=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data"
],
]);
$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://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references")
.header("Authorization", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"referenceFiles": [
{
"createdBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>",
"uid": "<string>",
"userName": "<string>"
},
"dateCreated": "2023-11-07T05:31:56Z",
"filename": "<string>",
"id": "<string>",
"note": "<string>",
"uid": "<string>"
}
]
}Create project reference files
The json request part allows sending additional data as JSON,
such as a text note that will be used for all the given reference files.
In case no file parts are sent, only 1 reference is created with the given note.
Either at least one file must be sent or the note must be specified.
Example:
{
"note": "Sample text"
}
Required role: Administrator, Project Manager, Guest, or Submitter.
Maximum 50 files per request.
Vendor organizations may create reference files only if securitySettings.vendors.jobVendorsMayUploadReferences
is enabled on the project (see Get project).
curl --request POST \
--url https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form 'file={
"bytes": [
"aSDinaTvuI8gbWludGxpZnk="
],
"contentType": "<string>",
"empty": true,
"inputStream": {},
"name": "<string>",
"originalFilename": "<string>",
"size": 123
}'import requests
url = "https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--"
headers = {
"Authorization": "<api-key>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '{
"bytes": [
"aSDinaTvuI8gbWludGxpZnk="
],
"contentType": "<string>",
"empty": true,
"inputStream": {},
"name": "<string>",
"originalFilename": "<string>",
"size": 123
}');
const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
options.body = form;
fetch('https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references', 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://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references",
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=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: multipart/form-data"
],
]);
$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://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references")
.header("Authorization", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.memsource.com/web/api2/v2/projects/{projectUid}/references")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n{\r\n \"bytes\": [\r\n \"aSDinaTvuI8gbWludGxpZnk=\"\r\n ],\r\n \"contentType\": \"<string>\",\r\n \"empty\": true,\r\n \"inputStream\": {},\r\n \"name\": \"<string>\",\r\n \"originalFilename\": \"<string>\",\r\n \"size\": 123\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"referenceFiles": [
{
"createdBy": {
"email": "<string>",
"firstName": "<string>",
"id": "<string>",
"lastName": "<string>",
"uid": "<string>",
"userName": "<string>"
},
"dateCreated": "2023-11-07T05:31:56Z",
"filename": "<string>",
"id": "<string>",
"note": "<string>",
"uid": "<string>"
}
]
}Authorizations
Get a token from auth/login endpoint and then pass it in the Authorization HTTP header in every subsequent API call. For more information visit our help center.
Path Parameters
Body
Multipart request with files and JSON
Response
Created
Show child attributes
Show child attributes
Was this page helpful?