Create or update an ontology-backed entry
curl --request POST \
--url https://api.swapnice.com/v1/entries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"ontology": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"entry_name": "<string>",
"fields": {},
"entry_id": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": [
"<string>"
]
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ontology: '<string>',
owner_id: '<string>',
ingestion_origin: '<string>',
entry_name: '<string>',
fields: {},
entry_id: '<string>',
value: 123,
image_upload_status: 'uploaded',
media: {primary_image: '<string>', gallery: ['<string>']}
})
};
fetch('https://api.swapnice.com/v1/entries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/entries"
payload = {
"ontology": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"entry_name": "<string>",
"fields": {},
"entry_id": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": ["<string>"]
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "created",
"entry": {
"entry_id": "<string>",
"ontology": "<string>",
"entry_name": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": [
"<string>"
]
},
"fields": {},
"checksum": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Entries and ontologies
Create or upsert an entry
Add a catalog object events can reference.
POST
/
v1
/
entries
Create or update an ontology-backed entry
curl --request POST \
--url https://api.swapnice.com/v1/entries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"ontology": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"entry_name": "<string>",
"fields": {},
"entry_id": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": [
"<string>"
]
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ontology: '<string>',
owner_id: '<string>',
ingestion_origin: '<string>',
entry_name: '<string>',
fields: {},
entry_id: '<string>',
value: 123,
image_upload_status: 'uploaded',
media: {primary_image: '<string>', gallery: ['<string>']}
})
};
fetch('https://api.swapnice.com/v1/entries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.swapnice.com/v1/entries"
payload = {
"ontology": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"entry_name": "<string>",
"fields": {},
"entry_id": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": ["<string>"]
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "created",
"entry": {
"entry_id": "<string>",
"ontology": "<string>",
"entry_name": "<string>",
"owner_id": "<string>",
"ingestion_origin": "<string>",
"value": 123,
"image_upload_status": "uploaded",
"media": {
"primary_image": "<string>",
"gallery": [
"<string>"
]
},
"fields": {},
"checksum": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}{
"error": {
"code": "consent_denied",
"message": "<string>",
"request_id": "<string>",
"details": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}
}Add a catalog object events can reference.
Use the returned
entry_id as object on events. Guide: entries and ontologies.Authorizations
OAuth 2.1 authorization code with PKCE. Implicit and password flows are unsupported.
Headers
Required for mutating requests. Replays with the same key and payload hash return
the original logical result; replays with a different payload hash return 409.
Required string length:
16 - 255Body
application/json
Optional when deterministic identity fields can derive it.
Available options:
uploaded, staged, missing Show child attributes
Show child attributes
⌘I