curl --request POST \
--url https://{organization}.rescueconsole.com/api/organizations/organizations/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dry_run": true,
"rows": [
{
"name": "Contoso Animal Hospital",
"kind": "Vet",
"phone": "207-555-0190",
"address": "55 Forest Avenue",
"city": "Portland",
"region": "ME",
"postal_code": "04101",
"country": "US",
"relationship": "client"
},
{
"name": "Contoso Feed and Supply",
"kind": "vendor",
"website": "contoso.com",
"relationship": "supplier"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dry_run: true,
rows: [
{
name: 'Contoso Animal Hospital',
kind: 'Vet',
phone: '207-555-0190',
address: '55 Forest Avenue',
city: 'Portland',
region: 'ME',
postal_code: '04101',
country: 'US',
relationship: 'client'
},
{
name: 'Contoso Feed and Supply',
kind: 'vendor',
website: 'contoso.com',
relationship: 'supplier'
}
]
})
};
fetch('https://{organization}.rescueconsole.com/api/organizations/organizations/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/organizations/organizations/import"
payload = {
"dry_run": True,
"rows": [
{
"name": "Contoso Animal Hospital",
"kind": "Vet",
"phone": "207-555-0190",
"address": "55 Forest Avenue",
"city": "Portland",
"region": "ME",
"postal_code": "04101",
"country": "US",
"relationship": "client"
},
{
"name": "Contoso Feed and Supply",
"kind": "vendor",
"website": "contoso.com",
"relationship": "supplier"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"dry_run": true,
"total_rows": 123,
"would_create": 123,
"created": 123,
"skipped": [
{
"line": 123,
"name": "<string>",
"reason": "<string>"
}
],
"errors": [
{
"line": 123,
"message": "<string>"
}
],
"preview": [
{
"line": 123,
"name": "<string>",
"kind": "veterinary_practice",
"email": "<string>",
"relationship": "<string>"
}
]
}{
"dry_run": true,
"total_rows": 123,
"would_create": 123,
"created": 123,
"skipped": [
{
"line": 123,
"name": "<string>",
"reason": "<string>"
}
],
"errors": [
{
"line": 123,
"message": "<string>"
}
],
"preview": [
{
"line": 123,
"name": "<string>",
"kind": "veterinary_practice",
"email": "<string>",
"relationship": "<string>"
}
]
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Import organizations
Adds organizations from the rows of a spreadsheet you have read into JSON, 2,000 rows at most. Send dry_run: true first to see what would happen: the real run makes the same checks. The whole file is checked before anything is written, and if any row has an error nothing is written: a dry run answers 200 with the errors listed, a real run answers 400 with the same summary. A row whose name is already in the directory (ignoring case, archived ones included) is skipped and not updated, and the same name twice in the file is an error. Line numbers count your header as line 1, so the first row you send is line 2. An imported organization’s address and phone are saved on it, but no main location is made for them and nothing is added to its history. Needs write on Organizations.
curl --request POST \
--url https://{organization}.rescueconsole.com/api/organizations/organizations/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dry_run": true,
"rows": [
{
"name": "Contoso Animal Hospital",
"kind": "Vet",
"phone": "207-555-0190",
"address": "55 Forest Avenue",
"city": "Portland",
"region": "ME",
"postal_code": "04101",
"country": "US",
"relationship": "client"
},
{
"name": "Contoso Feed and Supply",
"kind": "vendor",
"website": "contoso.com",
"relationship": "supplier"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dry_run: true,
rows: [
{
name: 'Contoso Animal Hospital',
kind: 'Vet',
phone: '207-555-0190',
address: '55 Forest Avenue',
city: 'Portland',
region: 'ME',
postal_code: '04101',
country: 'US',
relationship: 'client'
},
{
name: 'Contoso Feed and Supply',
kind: 'vendor',
website: 'contoso.com',
relationship: 'supplier'
}
]
})
};
fetch('https://{organization}.rescueconsole.com/api/organizations/organizations/import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/organizations/organizations/import"
payload = {
"dry_run": True,
"rows": [
{
"name": "Contoso Animal Hospital",
"kind": "Vet",
"phone": "207-555-0190",
"address": "55 Forest Avenue",
"city": "Portland",
"region": "ME",
"postal_code": "04101",
"country": "US",
"relationship": "client"
},
{
"name": "Contoso Feed and Supply",
"kind": "vendor",
"website": "contoso.com",
"relationship": "supplier"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"dry_run": true,
"total_rows": 123,
"would_create": 123,
"created": 123,
"skipped": [
{
"line": 123,
"name": "<string>",
"reason": "<string>"
}
],
"errors": [
{
"line": 123,
"message": "<string>"
}
],
"preview": [
{
"line": 123,
"name": "<string>",
"kind": "veterinary_practice",
"email": "<string>",
"relationship": "<string>"
}
]
}{
"dry_run": true,
"total_rows": 123,
"would_create": 123,
"created": 123,
"skipped": [
{
"line": 123,
"name": "<string>",
"reason": "<string>"
}
],
"errors": [
{
"line": 123,
"message": "<string>"
}
],
"preview": [
{
"line": 123,
"name": "<string>",
"kind": "veterinary_practice",
"email": "<string>",
"relationship": "<string>"
}
]
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Authorizations
An API key from Settings, API keys. It starts with rc_live_.
Body
Response
What the import did, or would do on a dry run.
How many organizations the rows make.
How many organizations were made: 0 on a dry run or when there are errors.
Rows whose name is already in the directory.
Show child attributes
Show child attributes
What is wrong, by line. Any error means nothing is written.
Show child attributes
Show child attributes
The first 10 organizations the rows make.
Show child attributes
Show child attributes