Partners

The Partner resource type represents a CodeGuard Partner record which itself can be used to create and manage User records. This API can only be used to create, list, and delete partners.

Context

Requests to the Partner resource can only be made by authenticated partners who have been given the required permission to manage other partners. The api_key parameter must be passed with every request and contain a valid Partner API Key.

Attributes

The following are the attributes associated with the Partner resource. Whether they are required or optional is specified in the sections that follow.

name

The name of the partner. This is used for email communication and display in the application interface.

id

Unique numeric ID used to identify the Partner resource in the CodeGuard application.

api_key

Partner-specific token for CodeGuard API access. Note: This value is only returned after the Partner creation request. It is not mutable using this API and it is never returned as part of the user resource after creation.

active

This field indicates if the Partner account is enabled and functional (true) or has been suspended (false).

direct_login

This specifies whether Users who belong to this partner are able to log in to the CodeGuard application directly or if they are restricted to OAuth-only logins.

domain

The custom domain to be used for the CodeGuard dashboard (e.g. backups.myhost.com). The desired host must have a CNAME DNS entry which points to cname.totalwebsiteprotection.com.

email

The address to be used as the reply-to in transactional email notifications for customers created by this partner.

help_url

The link to the partner support center, knowledge base or other self-service help resources. This URL is provided to customers in the CodeGuard UI and email communication.

manages_connections

This specifies whether Users are able to access and modify connection settings for their backups. In some cases, where backups are configured automatically it is preferable to prevent customers from altering this information.

owner_id

This is the User ID which can administer the Partner record. An owner is not required.

parent_partner_id

Some Partners can create other partners in a parent-child relationship. If a parent exists, this field indicates the Partner ID that can administer this Partner.

partner_billing

This specifies whether the Partner bills the customers or whether the customer has signed up directly with CodeGuard and provided their credit card for automatic renewal billing by CodeGuard.

portal

The Partner Portal is a feature in the CodeGuard Dashboard available to the User designated as the Partner Owner via owner_id.

upgrade_url

This is the link to a location where a customer can use to change their CodeGuard plan. This should be specified in cases where partner_billing is true. This URL is provided to customers in the CodeGuard UI and email communication.

Create Partners

This method is used to create new CodeGuard partners.

URI: /partners

Method: POST

Required Attributes

The request will not succeed without these attributes.

Optional Attributes
Example Request

        curl -v
        -H "Content-type: application/json"
        -H "Accept: application/json"
        -X POST
        -d '{"partner" : {"name" : "A New Partner", "email" : "support@myhost.com"}'
        https://api.codeguard.com/partners?api_key=012c513e6d309c158a19bcbc86bb7a88
        
Example Response

        {
            "partner": {
                "id":39763,
                "name":"A New Partner",
                "email":"first.lastname@co.com",
                "active":false,
                "direct_login":false,
                "api_key":"de83612c9ab6b4bb7d9213ba7d5a259b",
                "domain":null,
                "email":"support@myhost.com",
                "help_url":null,
                "manages_connections":false,
                "owner_id":null,
                "parent_partner_id":88
                "partner_billing":false,
                "portal":false,
                "upgrade_url":null
            }
        }
        

List Partners

URI: /partners/<PARTNER ID>

Method: GET

Required Attributes

The request will not succeed without these attributes.

Required Attributes

None

Optional Attributes

None

Example Request

        curl -v
        -H "Content-type: application/json"
        -H "Accept: application/json"
        https://api.codeguard.com/partners/39763?api_key=012c513e6d309c158a19bcbc86bb7a88
        
Example Response

        {
            "partner": {
                "id":39763,
                "name":"A New Partner",
                "email":"first.lastname@co.com",
                "active":false,
                "direct_login":false,
                "domain":null,
                "email":"support@myhost.com",
                "help_url":null,
                "manages_connections":false,
                "owner_id":null,
                "parent_partner_id":88
                "partner_billing":false,
                "portal":false,
                "upgrade_url":null
            }
        }
        

Delete Partners

This method is used to delete existing CodeGuard partners that were created by another Partner. Partners can only delete partners which they have created and are associated using the appropriate parent_partner_id. Deleting a partner resource will also delete all Users, associated Website and Database records.

URI: /partners/<id>

Method: DELETE

Required Attributes

None

Optional Attributes

None

Example Request

        curl -i
        -X DELETE
        https://api.codeguard.com/partners/39763?api_key=3a912fdd3c8657584aa8f4bbb1bce174