Proxies

Proxies

The Proxies resource is the primary way of publishing and managing reverse proxy sites within the platform

Proxy Model

Proxy object

A proxy object contains the following fields
Attribute
Type
Description
id
integer
unique id of the proxy
business_id
integer
Reference id to the Business this proxy is under
user_id
integer
Reference id to the User that created this proxy
domain
string
The hostname/domain where the proxy is published
source_domain
string
The URL without including the path of the site you want to proxy
deleted
boolean
Field that denotes if the proxy is disabled or not
https
boolean
Toggle for enabling SSL for the proxy
extra_css
string
Extra CSS to add to all the proxy's pages
footer_code
string
Extra HTML to add to all the proxy's pages right before the ending </body> tag
header_code
string
Extra HTML to add to all the proxy's pages right before the ending </head> tag
added
timestamp
Date and time proxy was created
modified
timestamp
Date and time proxy was modified
ssl_last_updated
string
Timestamp of when the proxy's SSL was last updated
custom_fields
object
Custom field values assigned to the site

Example object:

1
{
2
"added": "2016-12-07T19:20:26",
3
"aliases": [],
4
"autolink": false,
5
"business": {
6
... fully expanded `Business` object
7
},
8
"business_id": 12345,
9
"cache_html": false,
10
"country": "US",
11
"custom_fields": {
12
"campaign_id": "GA12345"
13
},
14
"deleted": false,
15
"disable_analytics_events": ["form-submit"],
16
"domain": "www.yourproxydomain.com",
17
"extra_css": ".body { background-color: red }",
18
"filter_querystring": true,
19
"footer_code": "<script>...</script>",
20
"formatted_url": "http://www.yourproxydomain.com/",
21
"gtm_id": 'ABG456',
22
"header_code": "<meta .../>",
23
"https": false,
24
"id": 54321,
25
"ignored_numbers": [],
26
"image_replacements": [
27
{
28
"image_id": 654321,
29
"image_path": "/assets/some-image.jpg"
30
}
31
],
32
"include_jquery": "1.11.0",
33
"modified": "2017-03-20T13:42:10",
34
"number_replacements": [
35
{
36
"new_number": "206-777-7777",
37
"number": "206-555-5555"
38
},
39
{
40
"new_number": "206-999-9999",
41
"number": "206-666-6666"
42
}
43
],
44
"partner_proxy_category_id": null,
45
"partner_proxy_id": null,
46
"partner_proxy_sub_id": null,
47
"phone": null,
48
"preview_url": "http://www.yourproxydomain.com.yourwhitelabel.cloudbackend.net/",
49
"replace_patterns": [
50
{
51
"string_to_replace": "Shop today",
52
"replacement_string": "Shop tomorrow"
53
}
54
],
55
"resource_uri": "/api/v2/proxies/54321/",
56
"source_domain": "http://www.customerdomain.com",
57
"ssl_last_updated": null,
58
"user_id": 1234
59
}
Copied!

List proxies

List all proxies including active, deleted, non-published and published
1
GET /api/v2/proxies/
Copied!
List all active proxies
1
GET /api/v2/proxies/?deleted=0
Copied!

Parameters

Name
Type
Description
business_id
string
Filter for proxies associated with a particular Business
deleted
string
Return proxies based on if they are active (0) or deleted/disabled (1)
formatted_domain
string
Searching by domain/subdomain similar to how you pass formatted_domain on Proxy creation
partner_proxy_id
string
Used to lookup/search for proxies matching a particular internal id

Response

1
{
2
"meta":{
3
"limit":20,
4
"next":null,
5
"offset":0,
6
"previous":null,
7
"total_count":1
8
},
9
"objects":[
10
{
11
"added": "2016-07-26T19:39:18",
12
"autolink": false,
13
"base_directory": "/",
14
"business_id": 24305,
15
"country": "US",
16
"deleted": false,
17
"domain": "someproxy.cloudbackend.net",
18
"extra_css": null,
19
"footer_code": null,
20
"header_code": null,
21
"https": false,
22
"id": 12345,
23
"modified": "2016-07-26T19:39:18",
24
"partner_proxy_id": null,
25
"phone": "(206) 555-5555",
26
"replace_patterns": [],
27
"resource_uri": "/api/v2/proxies/12345/",
28
"source_domain": "http://www.example.com",
29
"theme_settings": {},
30
"user_id": 123
31
},
32
{
33
"added": "2016-07-26T19:39:18",
34
"autolink": false,
35
"base_directory": "/",
36
"business_id": 24305,
37
"country": "US",
38
"deleted": false,
39
"domain": "anotherproxy.cloudbackend.net",
40
"extra_css": null,
41
"footer_code": null,
42
"header_code": null,
43
"https": false,
44
"id": 12346,
45
"modified": "2016-07-26T19:39:18",
46
"partner_proxy_id": null,
47
"phone": "(206) 555-5555",
48
"replace_patterns": [],
49
"resource_uri": "/api/v2/proxies/12346/",
50
"source_domain": "http://www.example.com",
51
"theme_settings": {},
52
"user_id": 123
53
},
54
...
55
]
56
}
Copied!

Get a single proxy

Fetch the Proxy detail using the Proxy.id
1
GET /api/v2/proxies/:id/
Copied!

Response

1
{
2
"added": "2016-07-26T19:39:18",
3
"autolink": false,
4
"base_directory": "/",
5
"business": {
6
... fully expanded `Business` object
7
},
8
"business_id": 24305,
9
"country": "US",
10
"deleted": false,
11
"disable_cache": false,
12
"domain": "someproxy.cloudbackend.net",
13
"extra_css": null,
14
"footer_code": null,
15
"header_code": null,
16
"https": false,
17
"id": 12345,
18
"modified": "2016-07-26T19:39:18",
19
"partner_proxy_id": null,
20
"phone": "(206) 555-5555",
21
"replace_patterns": [],
22
"resource_uri": "/api/v2/proxies/12345/",
23
"source_domain": "http://www.example.com",
24
"theme_settings": {},
25
"user_id": 123
26
}
Copied!

Create a proxy

1
POST /api/v2/proxies/
Copied!

Parameters

Name
Type
Description
domain
string
required
source_domain
string
required Full URL of the source site (i.e. http://www.example.com). Supports http and https schemas
user_id or partner_user_id
integer or string
required If you know the user account you want to publish this proxy on the behalf of, use user_id. If you don't know the user ID, you can use the partner_user_id method described further down this document.
Optional
base_directory
string
Under private labels with sub-directory based proxies, this is where it is defined (defaults to slash / but an example might be /some-page/)

Example

1
{
2
"domain": "someproxy.cloudbackend.net",
3
"source_domain": "http://www.example.com",
4
"user_id": 1
5
}
Copied!

Response

A status code of 201 created is returned on a successful creation and contains the created proxy object as JSON. See the Get a single proxy section for an example Proxy object.

Updating a proxy

1
PUT /api/v2/proxies/:id/
Copied!
You can PUT a partial or full object to the detail endpoint to update/change values on the Proxy object. If using a partial object, you must insure that the primary proxy id is part of the payload.

Disabling / enabling a proxy

Disabling a proxy

To disable an active proxy and clear all cache references to the domain, use the DELETE method on the Proxy detail endpoint.
1
DELETE /api/v2/proxies/:id/
Copied!

Enabling a proxy

To enable a currently disabled proxy, you will set the param for deleted to False using the Proxy update endpoint.
Last modified 1yr ago