Export Folders

Exports can be organized in folders.

A folder has the following attributes

Parameter

Type

Description

href

String

the URI for the folder.

id

String

The unique ID of the folder.

name

String

Name of the folder.

site_id

String

ID of the site to which the folder belongs.

folder_id

String

ID of the parent folder.

type

String

Always has value folder.

created_at

String

Date and time, when the folder was created.

updated_at

String

Date and time, when the folder was last updated.

updated_by

String

Email of the user, who updated the folder last.

POST Create Folder

Action: POST /sites/{site_id}/crm/folders

Create an export folder using this action. It takes a JSON object containing a folder definition. The user must have at the super_manager role on the export's site.

cURL
Untitled
Untitled
cURL
curl --request POST \
--header "Authorization: Bearer $access_token" \
--header "Content-Type: application/json" \
--header "Accept: application/vnd.salemove.v1+json" \
--data-binary '{
"name": "POC"
}' \
"https://api.salemove.com/sites/$site_id/crm/folders"
Untitled
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.open(
'POST',
`https://api.salemove.com/sites/${site_id}/crm/folders`,
false
);
xhr.setRequestHeader('authorization', `Bearer ${accessToken}`);
xhr.setRequestHeader('content-type', 'application/json');
xhr.setRequestHeader('accept', 'application/vnd.salemove.v1+json');
var data = {
name: 'POC'
};
var query = JSON.stringify(data);
xhr.send(query);
var response = JSON.parse(xhr.responseText);
console.log(response);
Untitled
require 'httparty'
ENDPOINT = 'https://api.salemove.com/sites'
token = ARGV[0].strip
site_id = ARGV[1].strip
headers = {
:authorization => "Bearer #{access_token}",
:content_type => "application/json",
:accept => "application/vnd.salemove.v1+json"
}
options = {
headers: headers,
query: {
"name": "POC"
}
}
raw_response = HTTParty.post(
"#{ENDPOINT}/#{site_id}/crm/folders",
options
)
response = JSON.parse raw_response.body
puts response

Generates the Output

{
"id": "86313e78-a521-42c0-9477-97f5c4565fc8",
"folder_id": null,
"name": "POC",
"site_id": "2e56b224-6708-4755-b6c9-35f9889e42dd",
"created_at": "2017-02-15T12:34:56.317509Z",
"updated_at": "2017-02-19T11:17:41.298641Z",
"updated_by": "admin@company.com",
"type": "folder",
"href": "https://api.salemove.com/sites/2e56b224-6708-4755-b6c9-35f9889e42dd/crm/folders/86313e78-a521-42c0-9477-97f5c4565fc8"
}

GET Export Folder

Action: GET /sites/{site_id}/crm/folders/{id}

The Authorization header must contain the bearer access token of the user who has at least manager role on the export folder's site.

cURL
Untitled
Untitled
cURL
curl --request GET \
--header "Authorization: Bearer $access_token" \
--header "Accept: application/vnd.salemove.v1+json" \
"https://api.salemove.com/sites/$site_id/crm/folders/$folder_id"
Untitled
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.open(
'GET',
`https://api.salemove.com/sites/${site_id}/crm/folders/folder`,
false
);
xhr.setRequestHeader('authorization', `Bearer ${accessToken}`);
xhr.setRequestHeader('accept', 'application/vnd.salemove.v1+json');
xhr.send();
var response = JSON.parse(xhr.responseText);
console.log(response);
Untitled
require 'httparty'
ENDPOINT = 'https://api.salemove.com/sites'
token = ARGV[0].strip
site_id = ARGV[1].strip
folder_id = ARGV[2].strip
headers = {
:authorization => "Bearer #{access_token}",
:accept => "application/vnd.salemove.v1+json"
}
raw_response = HTTParty.get(
"#{ENDPOINT}/#{site_id}/crm/folders/#{folder_id}",
headers: headers
)
response = JSON.parse raw_response.body
puts response

Generates the Output

{
"id": "86313e78-a521-42c0-9477-97f5c4565fc8",
"folder_id": null,
"name": "POC",
"site_id": "2e56b224-6708-4755-b6c9-35f9889e42dd",
"created_at": "2017-02-15T12:34:56.317509Z",
"updated_at": "2017-02-19T11:17:41.298641Z",
"updated_by": "admin@company.com",
"type": "folder",
"href": "https://api.salemove.com/sites/2e56b224-6708-4755-b6c9-35f9889e42dd/crm/folders/86313e78-a521-42c0-9477-97f5c4565fc8"
}

PUT Update Export Folder

Action: PUT /sites/{site_id}/crm/folders/{id}

Update an existing export folder on the given site. This action takes a JSON object containing an updated folder definition. The Authorization header must contain the bearer access token of the user who has the super_manager role on the folder's site.

cURL
Untitled
Untitled
cURL
curl --request PUT \
--header "Authorization: Bearer $access_token" \
--header "Content-Type: application/json" \
--header "Accept: application/vnd.salemove.v1+json" \
--data-binary '{
"name": "Leads"
}' \
"https://api.salemove.com/sites/$site_id/crm/folders/$folder_id"
Untitled
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.open('PUT', `https://api.salemove.com/sites/${site_id}`, false);
xhr.setRequestHeader('authorization', `Bearer ${accessToken}`);
xhr.setRequestHeader('content-type', 'application/json');
xhr.setRequestHeader('accept', 'application/vnd.salemove.v1+json');
var data = {
name: 'Leads'
};
var query = JSON.stringify(data);
xhr.send(query);
var response = JSON.parse(xhr.responseText);
console.log(response);
Untitled
require 'httparty'
ENDPOINT = 'https://api.salemove.com/sites'
token = ARGV[0].strip
site_id = ARGV[1].strip
folder_id = ARGV[2].strip
headers = {
:authorization => "Bearer #{access_token}",
:content_type => "application/json",
:accept => "application/vnd.salemove.v1+json"
}
options = {
headers: headers,
query: {
"name": "Leads"
}
}
raw_response = HTTParty.put(
"#{ENDPOINT}/#{site_id}/crm/folders/#{folder_id}",
options
)
response = JSON.parse raw_response.body
puts response

Generates the Output

{
"href": "https://api.salemove.com/sites/2e56b224-6708-4755-b6c9-35f9889e42dd/crm/folders/86313e78-a521-42c0-9477-97f5c4565fc8",
"name": "Leads",
"site_id": "2e56b224-6708-4755-b6c9-35f9889e42dd",
"folder_id": null,
"type": "folder",
"created_at": "2017-07-06T09:24:22Z",
"updated_at": "2017-09-14T11:53:42Z",
"updated_by": "manager@company.com"
}

DELETE Export Folder

Action: DELETE /sites/{site_id}/crm/folders/{id}

Delete an existing export folder on the site. Requires super_manager role on the given site.

cURL
Untitled
Untitled
cURL
curl --request DELETE \
--header "Authorization: Bearer $access_token" \
--header "Accept: application/vnd.salemove.v1+json" \
'https://api.salemove.com/sites/$site_id/crm/folders/$folder_id'
Untitled
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var xhr = new XMLHttpRequest();
xhr.open(
'DELETE',
`https://api.salemove.com/sites/${site_id}/crm/folders/${folder_id}`,
false
);
xhr.setRequestHeader('authorization', `Token ${token}`);
xhr.setRequestHeader('accept', 'application/vnd.salemove.v1+json');
xhr.send();
var response = xhr.responseText;
console.log(response);
Untitled
require 'httparty'
ENDPOINT = 'https://api.salemove.com/sites'
token = ARGV[0].strip
site_id = ARGV[1].strip
folder_id = ARGV[2].strip
headers = {
:authorization => "Token #{token}",
:accept => 'application/vnd.salemove.v1json'
}
raw_response = HTTParty.delete(
"#{ENDPOINT}/#{site_id}/crm/folders/#{folder_id}",
headers: headers
)
response = JSON.parse raw_response.body
puts response

Generates the Output