Skip to main content

9. ISP Go API

Users

[user_id] is the ISP's user ID. It can contain the characters A-Z, a-z, 0-9 underscore and dash.

The maximum length is 32 characters.

Creating a user

A new user is created when trying to create a property for him: specify categories, assign ip.

POST /users/[user_id]/ip/[“ip_address”]
Deleting a user
DELETE /users/[user_id]
Check a user existence:
HEAD /users/[user_id]

If a user is not found returns HTTP response code 404.

Getting a list of active users
GET /active_users/

Response format:

["geek", "bugtest", "hammer"]

Active users are users which have at least one IP address.

Getting a list of all users
GET /users

Response format:

[{
  "name": "geek",
  "safesearch": "off",
  "safeyoutube": "off",
  "status": "enabled",
  "filter": [1, 2],
  "ip": ["192.168.5.6", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"],
  "whitelist": ["facebook.com", "google.com"],
  "blacklist": []
},{
  "name": "bugtest",
  "safesearch": "off",
  "safeyoutube": "on",
  "status": "enabled",
  "filter": [1, 2, 3],
  "ip": ["192.168.5.8"],
  "whitelist": ["reddit.com", "google.com"],
  "blacklist": []
}]

By default, returns first 100 users.

GET /users?start=100&stop=200

Start and stop parameters indicate that should be returned users with user_id from 100 to 200.

Search a user
GET /search/user1

Response format:

[{
  "name": "user1",
  "safesearch": "off",
  "safeyoutube": "off",
  "status": "enabled",
  "filter": [],
  "ip": [],
  "whitelist": [],
  "blacklist": []
}]

The search is possible by IP or username. Wildcards or masks can be used in the search.

GET /search/192.168.0.*

Returns all users which IP address starts with 192.168.0.

GET /search/user*

Returns all users which name starts with user

GET user’s information
GET /users/[user_id]

Response format:

{
  "name": "[user_id]",
  "safesearch": "off",
  "safeyoutube": "off",
  "status": "enabled",
  "filter": [3, 4, 5, 6],
  "ip": ["192.168.5.6", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"],
  "whitelist": ["reddit.com", "google.com"],
  "blacklist": []
}
Update user’s information
PUT /users/[user_id]

Content-type: application/json

{
  "name": "[user_id]"
  "safesearch": "on",
  "safeyoutube": "off",
  "status": "enabled",
  "filter": [2, 3, 4, 5],
  "ip": ["192.168.5.8", "2001:0db8:85a3:0000:0000:8a2e:0370:7334"],
  "whitelist": ["docs.google.com", "atlassian.net"],
  "blacklist" ["youtube.com", "pornhub.com"]
}
Disable filtering

This feature allows users to suspend filtering without settings reset.

POST /users/[user_id]/status/disabled

Content-type: application/json
Enable filtering
POST /users/[user_id]/status/enabled

Content-type: application/json

 

SafeSearch


PUT /config/

Content-type: application/json

{ "safesearch": true }
Disabling safe search by default for a user
PUT /config/

Content-type: application/json

{ "safesearch": false }
Enabling safe search by default for users
PUT /userconfig/

Content-type: application/json

{ "safesearch": true }
Disabling safe search by default for users
PUT /userconfig/

Content-type: application/json

{ "safesearch": false }
Enabling safe Search for [user_id]
POST /users/[user_id]/safesearch/on

Content-type: application/json
Disabling safe Search for [user_id]
POST /users/[user_id]/safesearch/off

Content-type: application/json

 

Safe Youtube

If this option is enabled, the user will be automatically redirected to the safe version of YouTube.