Create an Asset (File)
1 min
POST
{{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset
Path Parameters
- BaseURLstringDefaultBaseURL
- containerAIDstringDefaultcontainerAID
- containerVersionstringDefaultcontainerVersion
Body Parameters
- bodyobjectDefault{ "assetType":"FILE", "label":"File Label", "name":"File Name", "identifier":"FIL_2", "description":[ { "locale":"", "text":"File description" }, { "locale":"fr-FR", "text":"File French description" } ], "clinicalStage":[ "Study setup", "Study conduct" ], "therapeuticArea":[ "Devices", "Hematology" ], "aliases":[ { "context":"RAVE", "name":"File Rave Alias", "orderNumber": 0 }, { "context":"SDTM", "name":"File SDTM Alias", "orderNumber": 1 } ], "fileReferences": [ { "uuid": "5f395559-e3f8-42cc-bc7b-946c1b0119e7", "path": "odm.fdx" } ], "entryPoint": { "uuid": "5f395559-e3f8-42cc-bc7b-946c1b0119e7", "path": "odm.fdx" }, "source": "Source is this" }
Responses
200
curl
curl --request POST \
--url {{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '"{\r\n \"assetType\":\"FILE\",\r\n \"label\":\"File Label\",\r\n \"name\":\"File Name\",\r\n \"identifier\":\"FIL_2\",\r\n \"description\":[\r\n {\r\n \"locale\":\"\",\r\n \"text\":\"File description\"\r\n },\r\n {\r\n \"locale\":\"fr-FR\",\r\n \"text\":\"File French description\"\r\n }\r\n ],\r\n \"clinicalStage\":[\r\n \"Study setup\", \r\n \"Study conduct\"\r\n ],\r\n \"therapeuticArea\":[\r\n \"Devices\",\r\n \"Hematology\"\r\n ],\r\n \"aliases\":[\r\n {\r\n \"context\":\"RAVE\",\r\n \"name\":\"File Rave Alias\",\r\n \"orderNumber\": 0\r\n },\r\n {\r\n \"context\":\"SDTM\",\r\n \"name\":\"File SDTM Alias\",\r\n \"orderNumber\": 1\r\n }\r\n ],\r\n \"fileReferences\": [\r\n {\r\n \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n \"path\": \"odm.fdx\"\r\n }\r\n ],\r\n \"entryPoint\": {\r\n \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n \"path\": \"odm.fdx\"\r\n },\r\n \"source\": \"Source is this\"\r\n}"'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify("{\r\n \"assetType\":\"FILE\",\r\n \"label\":\"File Label\",\r\n \"name\":\"File Name\",\r\n \"identifier\":\"FIL_2\",\r\n \"description\":[\r\n {\r\n \"locale\":\"\",\r\n \"text\":\"File description\"\r\n },\r\n {\r\n \"locale\":\"fr-FR\",\r\n \"text\":\"File French description\"\r\n }\r\n ],\r\n \"clinicalStage\":[\r\n \"Study setup\", \r\n \"Study conduct\"\r\n ],\r\n \"therapeuticArea\":[\r\n \"Devices\",\r\n \"Hematology\"\r\n ],\r\n \"aliases\":[\r\n {\r\n \"context\":\"RAVE\",\r\n \"name\":\"File Rave Alias\",\r\n \"orderNumber\": 0\r\n },\r\n {\r\n \"context\":\"SDTM\",\r\n \"name\":\"File SDTM Alias\",\r\n \"orderNumber\": 1\r\n }\r\n ],\r\n \"fileReferences\": [\r\n {\r\n \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n \"path\": \"odm.fdx\"\r\n }\r\n ],\r\n \"entryPoint\": {\r\n \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n \"path\": \"odm.fdx\"\r\n },\r\n \"source\": \"Source is this\"\r\n}");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("{{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump("{\r\n \"assetType\":\"FILE\",\r\n \"label\":\"File Label\",\r\n \"name\":\"File Name\",\r\n \"identifier\":\"FIL_2\",\r\n \"description\":[\r\n {\r\n \"locale\":\"\",\r\n \"text\":\"File description\"\r\n },\r\n {\r\n \"locale\":\"fr-FR\",\r\n \"text\":\"File French description\"\r\n }\r\n ],\r\n \"clinicalStage\":[\r\n \"Study setup\", \r\n \"Study conduct\"\r\n ],\r\n \"therapeuticArea\":[\r\n \"Devices\",\r\n \"Hematology\"\r\n ],\r\n \"aliases\":[\r\n {\r\n \"context\":\"RAVE\",\r\n \"name\":\"File Rave Alias\",\r\n \"orderNumber\": 0\r\n },\r\n {\r\n \"context\":\"SDTM\",\r\n \"name\":\"File SDTM Alias\",\r\n \"orderNumber\": 1\r\n }\r\n ],\r\n \"fileReferences\": [\r\n {\r\n \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n \"path\": \"odm.fdx\"\r\n }\r\n ],\r\n \"entryPoint\": {\r\n \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n \"path\": \"odm.fdx\"\r\n },\r\n \"source\": \"Source is this\"\r\n}")
response = http.request(request)
puts response.read_body
python
import requests
import json
url = "{{BaseURL}}/repository/container/{{containerAID}}/{{containerVersion}}/asset"
payload = json.dumps("{\r\n \"assetType\":\"FILE\",\r\n \"label\":\"File Label\",\r\n \"name\":\"File Name\",\r\n \"identifier\":\"FIL_2\",\r\n \"description\":[\r\n {\r\n \"locale\":\"\",\r\n \"text\":\"File description\"\r\n },\r\n {\r\n \"locale\":\"fr-FR\",\r\n \"text\":\"File French description\"\r\n }\r\n ],\r\n \"clinicalStage\":[\r\n \"Study setup\", \r\n \"Study conduct\"\r\n ],\r\n \"therapeuticArea\":[\r\n \"Devices\",\r\n \"Hematology\"\r\n ],\r\n \"aliases\":[\r\n {\r\n \"context\":\"RAVE\",\r\n \"name\":\"File Rave Alias\",\r\n \"orderNumber\": 0\r\n },\r\n {\r\n \"context\":\"SDTM\",\r\n \"name\":\"File SDTM Alias\",\r\n \"orderNumber\": 1\r\n }\r\n ],\r\n \"fileReferences\": [\r\n {\r\n \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n \"path\": \"odm.fdx\"\r\n }\r\n ],\r\n \"entryPoint\": {\r\n \"uuid\": \"5f395559-e3f8-42cc-bc7b-946c1b0119e7\",\r\n \"path\": \"odm.fdx\"\r\n },\r\n \"source\": \"Source is this\"\r\n}")
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200