Additional Partner Information

Some utility functionality to provide insight about connectivity, Users and Partners.

Manually Create Users

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.

Test Website Connection Credentials

This method is used to test connectivity and return the preferred connection methods.

URI: /partners/test_website_connection

Method: POST

Required Attributes

The request will not succeed without these attributes.

Optional Attributes
Response Attributes & Details

Successful connection attempts will include all parameters below and respond with HTTP 200. All other HTTP statuses should be treated as errors.

Example Request (Password-based Authentication)

        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
        
Example Response - Success

HTTP Status: 200


        {
          "provider":"sftp",
          "port":2222,
          "authentication":"password"
        }
        
Example Response - Failure

HTTP Status: 400


        {
          "error" : {
            "message" : "Could not open connection to myhost.com."
          }
        }
        

Test Database Connection Credentials

This method is used to test connectivity and return the preferred connection methods.

URI: /partners/test_database_connection

Method: POST

Required Attributes

The request will not succeed without these attributes.

Optional Attributes
Response Attributes & Details

Successful connection attempts will include all parameters below and respond with HTTP 200. All other HTTP statuses should be treated as errors.

Example Request (Password-based Authentication)

        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
        
Example Response - Success

HTTP Status: 200


        {
          "provider":"direct",
          "port":3306,
          "authentication":"password"
        }
        
Example Response - Failure

HTTP Status: 400


        {
          "error" : {
            "message" : "Could not open connection to myhost.com."
          }
        }
        

User Logins

An array of user login events for a given time period. Each event includes the attributes below.

URI: /partners/user_login_report

Method: GET

Required Request Attributes

The request will not succeed without these attributes.

Response Attributes
Example Request

        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
        
Example Response

        [
          {
              "user_id":22489,
              "login_time":"2018-08-29T18:11:35+00:00"
          },
          {
              "user_id":22451,
              "login_time":"2018-08-29T18:13:07+00:00"
          }
        ]
        

Over Quota Users

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

Attributes
Required Attributes

The request will not succeed without these attributes.

Example Request
http get 'https://api.codeguard.com/partners/user_quota_report?api_key=5383238765c2b0cb1d15e24cbd772bf25'
        
Example Response
[{"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"}]
        

List IP Addresses

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

Required Attributes

None

Optional Attributes

None

Example Request
curl -v -H "Content-type: application/json"  -H "Accept: application/json" -X GET 'https://api.codeguard.com/whitelist_addresses'
        
Example Response

          [
            "54.236.233.46",
            "54.236.233.28",
            "54.174.91.34",
            "54.174.153.212",
            "54.174.115.171",
            "54.236.209.91"
          ]
        

Appendix

OAuth Information

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.

OAuth Attributes

Supported Time Zones

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"