Some utility functionality to provide insight about connectivity, Users
and Partners
.
You can manually create users with specified plan IDs and your partner API key at https://www.codeguard.com/premium_signup_custom.
You will need to pass the plan ID and your API key as a URL query string.
Example: https://www.codeguard.com/premium_signup_custom?plan_id=511&partner_api_key=abc123abc123abc123
Enter the user's name and email address in the appropriate fields and click "Create My Account".
This will create a user with the plan ID specified, and they will belong to the partner with the specified API key.
This method is used to test connectivity and return the preferred connection methods.
URI: /partners/test_website_connection
Method: POST
The request will not succeed without these attributes.
Successful connection attempts will include all parameters below and respond with HTTP 200. All other HTTP statuses should be treated as errors.
curl -v
-H "Content-type: application/json"
-H "Accept: application/json"
-X POST '
https://api.codeguard.com/partners/test_website_connection\
&api_key=abc123abc123abc123\
&hostname=myhost.com\
&account=user\
&password=mypass
HTTP Status: 200
{
"provider":"sftp",
"port":2222,
"authentication":"password"
}
HTTP Status: 400
{
"error" : {
"message" : "Could not open connection to myhost.com."
}
}
This method is used to test connectivity and return the preferred connection methods.
URI: /partners/test_database_connection
Method: POST
The request will not succeed without these attributes.
Successful connection attempts will include all parameters below and respond with HTTP 200. All other HTTP statuses should be treated as errors.
curl -v
-H "Content-type: application/json"
-H "Accept: application/json"
-X POST '
https://api.codeguard.com/partners/test_database_connection\
&api_key=abc123abc123abc123\
&hostname=myhost.com\
&account=user\
&password=mypass
HTTP Status: 200
{
"provider":"direct",
"port":3306,
"authentication":"password"
}
HTTP Status: 400
{
"error" : {
"message" : "Could not open connection to myhost.com."
}
}
An array of user login events for a given time period. Each event includes the attributes below.
URI: /partners/user_login_report
Method: GET
The request will not succeed without these attributes.
2018-08-03T00:00:00Z
2018-08-04T00:00:00Z
curl -v
-H "Content-type: application/json"
-H "Accept: application/json"
-X POST '
https://api.codeguard.com/partners/user_login_report\
&api_key=abc123abc123abc123\
&start=2018-08-29T00:00:00Z\
&end=2018-08-30T00:00:00Z
[
{
"user_id":22489,
"login_time":"2018-08-29T18:11:35+00:00"
},
{
"user_id":22451,
"login_time":"2018-08-29T18:13:07+00:00"
}
]
An array of Users
who are using more than their allowed disk quota. Full User
models are not included. Only the Attributes listed below.
URI: /partners/user_quota_report
Method: GET
User
account creation.The request will not succeed without these attributes.
http get 'https://api.codeguard.com/partners/user_quota_report?api_key=5383238765c2b0cb1d15e24cbd772bf25'
[{"usage":2147483648,"email":"test11@codeguard.com","signup_date":"2013-07-22 20:08:42 UTC","quota":1073741824,"package":73,"percent_usage":200.0,"overage_date":"2013-07-23 19:14:15 UTC"}]
It is very important that our IP addresses be whitelisted on any firewall rules on your server. This call will return a list of our current IP addresses that are required for whitelisting. While our IP addresses don't often change, should they change, you will always have the updated list of IP addresses using this call.
This is public, so there is no need for authentication.
URI: /whitelist_addresses
Method: GET
None
None
curl -v -H "Content-type: application/json" -H "Accept: application/json" -X GET 'https://api.codeguard.com/whitelist_addresses'
[
"54.236.233.46",
"54.236.233.28",
"54.174.91.34",
"54.174.153.212",
"54.174.115.171",
"54.236.209.91"
]
The CodeGuard API uses OAuth 1.0 with long-lived tokens generated at the time of User
account creation. There are clients available for a variety of languages that can be used as libraries or reference examples. In order to authenticate to CodeGuard using OAuth, the required attributes below must be included as URL parameters.
Below is the complete list of supported time zone values that can be given to a User
.
"Australia/Hobart"
"Europe/Bratislava"
"Australia/Adelaide"
"America/Chicago"
"America/Godthab"
"America/Denver"
"Pacific/Port_Moresby"
"Europe/Budapest"
"Pacific/Pago_Pago"
"Asia/Rangoon"
"Europe/Minsk"
"Asia/Karachi"
"Asia/Riyadh"
"Africa/Algiers"
"Asia/Jakarta"
"Europe/Moscow"
"Asia/Vladivostok"
"Europe/Ljubljana"
"Africa/Casablanca"
"Pacific/Midway"
"Europe/Prague"
"Asia/Hong_Kong"
"Australia/Darwin"
"Asia/Dhaka"
"Europe/Rome"
"Europe/Bucharest"
"Africa/Nairobi"
"Asia/Ulaanbaatar"
"Asia/Kabul"
"Asia/Yerevan"
"Atlantic/South_Georgia"
"Asia/Taipei"
"Asia/Tashkent"
"Asia/Dhaka"
"Pacific/Fiji"
"Europe/Moscow"
"America/Mexico_City"
"Asia/Chongqing"
"Asia/Krasnoyarsk"
"Europe/Paris"
"America/Juneau"
"Europe/Belgrade"
"America/Sao_Paulo"
"Pacific/Auckland"
"Etc/UTC"
"Africa/Cairo"
"America/Los_Angeles"
"Asia/Kuala_Lumpur"
"Africa/Monrovia"
"Europe/Berlin"
"Europe/Skopje"
"Europe/Warsaw"
"Europe/Dublin"
"America/Indiana/Indianapolis"
"Europe/Amsterdam"
"Europe/Kiev"
"Asia/Karachi"
"America/Mexico_City"
"Asia/Kolkata"
"Asia/Bangkok"
"Europe/Athens"
"Asia/Singapore"
"Europe/Stockholm"
"Asia/Baghdad"
"America/Regina"
"Africa/Johannesburg"
"Europe/Istanbul"
"Asia/Tokyo"
"America/Argentina/Buenos_Aires"
"Asia/Yekaterinburg"
"America/Chihuahua"
"America/Argentina/San_Juan"
"Pacific/Majuro"
"America/Phoenix"
"America/Monterrey"
"Pacific/Guam"
"Asia/Yakutsk"
"Asia/Baku"
"Asia/Jerusalem"
"Asia/Novosibirsk"
"Asia/Kuwait"
"Europe/Helsinki"
"Europe/Lisbon"
"Asia/Kolkata"
"Europe/Sarajevo"
"Europe/Sofia"
"Europe/Brussels"
"America/Halifax"
"Asia/Kamchatka"
"Pacific/Noumea"
"Asia/Tokyo"
"America/New_York"
"Europe/Tallinn"
"Asia/Shanghai"
"Australia/Melbourne"
"Asia/Irkutsk"
"Asia/Kolkata"
"America/Santiago"
"Asia/Colombo"
"Australia/Sydney"
"Asia/Urumqi"
"America/Lima"
"Asia/Magadan"
"Australia/Melbourne"
"Europe/Zagreb"
"Europe/Riga"
"America/Bogota"
"Atlantic/Cape_Verde"
"Europe/Vienna"
"Asia/Katmandu"
"Europe/Vilnius"
"America/La_Paz"
"Asia/Magadan"
"Europe/Madrid"
"America/Mazatlan"
"Pacific/Honolulu"
"Asia/Kolkata"
"Asia/Tehran"
"Pacific/Auckland"
"Asia/Seoul"
"Europe/Copenhagen"
"Europe/Dublin"
"America/Tijuana"
"America/St_Johns"
"Asia/Muscat"
"Australia/Brisbane"
"America/Lima"
"Atlantic/Azores"
"Europe/London"
"Asia/Tokyo"
"Australia/Perth"
"America/Guatemala"
"Africa/Harare"
"Asia/Almaty"
"Pacific/Tongatapu"
"Asia/Bangkok"
"Asia/Muscat"
"Pacific/Midway"
"Europe/Moscow"
"Asia/Tbilisi"
"Europe/Berlin"
"America/Caracas"