NAV Navbar
PHP jQuery cURL

REST API Overview

The BoldGrid API uses HTTP methods and a RESTful endpoint structure. The API authorization framework is OAuth 2.0. Parameters and be sent via query parameters or values in the request body. Requests are expected in the content-type: application/x-www-form-urlencoded. All API calls return JSON-formatted responses.

We have language bindings in PHP, JavaScript, and shell! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Environments

There are two API URL addresses used to prefix the API endpoints:

Environment Description URL
Sandbox Used for tests and development https://api-sandbox.boldgrid.com/
Live Production environment https://api.boldgrid.com/

Authentication

OAuth2

The BoldGrid REST API uses the OAuth 2.0 protocol to authorize calls. OAuth is an industry-standard open standard for authorization used by many companies to provide secure access to protected resources. As a certified reseller you’ll have access to any resources that you create. As an end-user, you’ll only be able to access your own resources.

Getting a Token

To authorize via token, use this code:

$data = array( 'grant_type' => 'client_credentials' );

$curl = curl_init();
curl_setopt( $curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
curl_setopt( $curl, CURLOPT_USERPWD, '<client_id>:<client_secret>' );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/oauth2/token?' . http_build_query( $data ) );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
# With shell, you can just pass the correct header with each request
curl -G "https://api.boldgrid.com/v1/oauth2/token" \
    -u "<client_id>:<client_secret>" \
    -d grant_type="client_credentials"
jQuery.ajax( {
    type: 'GET',
    url: 'https://api.boldgrid.com/v1/oauth2/token',
    headers: {
        'Authorization': "Basic " + btoa( '<client_id>' + ':' + '<client_secret>' )
    },
    data : {
        'grant_type' : 'client_credentials'
    }
} );

The above command returns JSON structured like this:

{
  "access_token": "abcdefabcdef.abcdefabcdef.abcdefabcdef",
  "scope": "https://api.boldgrid.com/v1/*",
  "expires_in": 7200,
  "token_type": "Bearer"
}

All authentication is token based, meaning you’ll need to send an authenticated token with each request. You can obtain an access token by using basic access authentication at the oauth2/token end-point. You’ll pass the client_id:client_secret base64 encoded credentials in the Authorization header. Afterwards, use the access token for authentication when you make REST API requests.

Short-Lived Token

Authentication tokens issued via this end-point will expire after the expires_in value elapses. You will need to programmatically keep track of the expiration time and request a new token before it expires.

Long-Lived Token

If you would prefer to get started quickly or have a smaller application, we can issue a token that doesn’t need to be refreshed. Permanent access tokens can be made available by contacting a BoldGrid Support agent. We recommend that large applications use short-lived tokens.

JSON Web Tokens

Our API uses JSON Web Tokens (JWT) to authenticate your requests. A JWT contains encoded claims within the token. You can decode a token using any standard JWT library, such as ones found at jwt.io. Our tokens are signed (JWS), meaning the contents can be viewed without knowing the key. Your token is formed by three segments of data separated by periods. Each segment can be base 64 decoded to reveal the following structure: header.payload.signature.

For more information on using JWT’s please see https://jwt.io/introduction/.

JWT Payload

Attribute Type Description
iss String The BoldGrid authentication environment: https://api.boldgrid.com
aud String The Account ID the token was issued to
sub String The subject of the token. The Account ID the token has access to.
exp Long Expiry time in seconds since the epoch UTC.
iat Long Issue time in seconds since the epoch UTC.
email String Email address of the subject’s account.

HTTP Request

https://api.boldgrid.com/v1/oauth2/token

Arguments

Parameter Description
grant_type Token grant type. Must be set to client_credentials.

The client_id and client_secret must be provided via the Authorization parameter in request header. The string client_id:client_secret should be base64 encoded and sent as a Basic authorization header parameter.

Example

If the client_id is equal to 12345 and the client_secret is equal to client-secret-key-abcd, then the value 12345:client-secret-key-abcd would be base64 encoded to: MTIzNDU6Y2xpZW50LXNlY3JldC1rZXktYWJjZA==. The header would then include the following value.

Authorization: Basic MTIzNDU1NjpzZWNyZXQta2V5LWFiY2RlZmdoaQ==

Response

Type Parameter Description
string access_token The access token issued by BoldGrid. After the access token expires, you must request a new access token.
string scope Scopes expressed in the form of resource URL endpoints. The value of the scope parameter is expressed as a list of space-delimited strings.
integer expires_in The lifetime of the access token, in seconds.
string token_type The type of the token issued as described in OAuth2.0 RFC6749, Section 7.1.

Using the token

curl -G https://api.boldgrid.com/v1/accounts/123 \
    -H "Authorization: Bearer token.goes.here"

After you receive a token you’ll need to pass it along with any requests that require authorization. Attach the access token to a header parameter, labeled “Authorization”. Your token should be prepended with the token type: Bearer, separated with a space.

Authorization: Bearer token.goes.here

Expiration

An expired token response:

{
    "status": 401,
    "message": "Error validating access token: Token Expired.",
    "code": "access_token_expired"
}

Your access token will become invalid after the lifetime of the token is reached. You’ll need to request a new access token after it’s expired. If the request response is a 401 and the you get the code: access_token_expired, you’ll need to request a new token. You’ll need to handle this response and request a new token automatically.

Account

Manage a user’s BoldGrid account. These API calls are used throughout BoldGrid Central and can be used to manage a single user’s account. An Account is also created automatically if you create a Connect Key.

Schema

Type Parameter Description
integer account_id Account ID
string email Primary email of the account.
string username Username of the account.
string name Name of primary user.
integer is_active Whether or not the account is active.
string created_at The date and time when this item was created, in Internet date and time format.

Authenticated Account

To specify the currently authenticated Account for any call where account_id is required, use a dash (-) in place of the account_id.

Example:

https://api.boldgrid.com/v1/accounts/-

Details

$curl = curl_init();
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/accounts/123' );
$result = curl_exec( $curl );
curl_close( $curl );
print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/accounts/123 \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/accounts/123",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "email": "test@email.com",
  "username": "tester12345",
  "name": "John Doe",
  "is_active": 1,
  "created_at": "2015-02-02T15:05:40-05:00"
}

Shows details for an account, by ID. For example, get the email address listed on an account.

HTTP Request

https://api.boldgrid.com/v1/accounts/account_id

Arguments

Parameter Description Type
account_id Account Id URL

Return

Returns the Account object or errors if unsuccessful.

Create

$data = array(
    'email' => 'testing@email.com',
    'password' => 'Qjadi!z$',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/accounts' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/accounts \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d email="testing@email.com" \
    -d password="Qjadi!z$"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/accounts",
    data: {
        "email": "testing@email.com",
        "password": "Qjadi!z$"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "email": "testing@email.com",
  "username": "tester12345",
  "name": "John Doe",
  "is_active": 1,
  "created_at": "2015-02-02T15:05:40-05:00"
}

Create an Account for a user. This call will send a confirmation email to the user.

HTTP Request

https://api.boldgrid.com/v1/accounts

Arguments

Parameter Description Type
email User’s unique email address Post
password User password Post

Return

Returns the Account object or errors if unsuccessful.

Email - Update

$data = array(
    'email' => 'testing@email.com',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/accounts/123/email' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/accounts/123/email \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d email="testing@email.com"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/accounts/123/email",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "email": "testing@email.com"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "email": "testing@email.com",
  "username": "tester12345",
  "name": "John Doe",
  "is_active": 1,
  "created_at": "2015-02-02T15:05:40-05:00"
}

Change an account’s email address.

HTTP Request

https://api.boldgrid.com/v1/accounts/account_id/email

Arguments

Parameter Description Type
account_id Account Id URL
email User’s unique email Post

Return

Returns the Account object or errors if unsuccessful.

Password - Update

$data = array(
    'old_password' => 'UpdatePassword123$',
    'new_password' => 'PasswordUpdate123$',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/accounts/123/password' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/accounts/123/password \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d old_password="UpdatePassword123$" \
    -d new_password="PasswordUpdate123$"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/accounts/123/password",
    data: {
        "old_password": "UpdatePassword123$",
        "new_password": "PasswordUpdate123$"
    },
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "password_updated": true
}

Change an account’s password.

HTTP Request

https://api.boldgrid.com/v1/accounts/account_id/password

Arguments

Parameter Description Type
account_id Account Id URL
old_password An account’s previous password Post
new_password An account’s new password Post

Return

Type Parameter Description
boolean password_updated Success status of requested update.

Password - Reset

$data = array(
    'email' => 'test1@email.com',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/accounts/password/reset' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/accounts/password/reset \
    -d email="test1@email.com"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/accounts/password/reset",
    data: {
        "email": "test1@email.com"
    }
} );

The above command returns JSON structured like this:

{
  "email_sent": true
}

Sends a reset password link to the email address given.

HTTP Request

https://api.boldgrid.com/v1/accounts/password/reset

Arguments

Parameter Description Type
email Account email address to send password reset link. Post

Return

Type Parameter Description
boolean email_sent Success status of request.

Transfer Request

$data = array(
    'connect_key' => '12345678-12345678-12345678-12345678',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/accounts/123/transfer/request' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/accounts/123/transfer/request \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d connect_key="12345678-12345678-12345678-12345678"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/accounts/123/transfer/request",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "connect_key": "12345678-12345678-12345678-12345678"
    }
} );

The above command returns JSON structured like this:

{
  "message": "Requires confirmation from user. Email Sent.",
  "transferred_key": false,
  "email": "tester@email.com",
  "email_success": true
}
{
  "transferred_key": true
}

Transfer an existing Connect Key to the given Account. This will trigger a confirmation process if the Connect Key is already in use by another email address. The confirmation process must be manually resolved.

This call will return a success (response code 200), only if the transfer could be performed without confirmation. In the case that confirmation is required, a status of response code of 202 will be returned.

HTTP Request

https://api.boldgrid.com/v1/accounts/account_id/transfer/request

Arguments

Parameter Description Type
account_id Account Id URL
connect_key Connect Key’s “key” value Post

Return

Note: message, email, error, and error_name are conditionally returned.

Type Parameter Description
string transferred_key Whether or not the key was transferred with the request.
string message Information about the request.
string email Email of user transferring from
string error Error that occurred while trying to add key
string error_name Name of error

Connect Key

A Connect Key object represents the product by an end user to access BoldGrid through their WordPress installation. The key field represents the value entered into a BoldGrid plugin and should be distributed to the end user.

Schema

Type Parameter Description
integer account_id An Account ID
integer connect_id A Connect ID
integer reseller_id A reseller ID
string key Connect Key value.
string type Type of Connect Key (basic/premium).
string label User friendly label for the Connect Key.
string status Current status of the Connect Key.
boolean is_premium Whether or not the Connect Key is premium.
boolean is_active Whether or not the Connect Key is active.
integer coin_balance Copyright Coin balance.
string first_connect Timestamp when a user first requested a preview build in the Inspiration process.
string last_connect Timestamp of the last API connection.
string created_at Timestamp of the creation of the Connect Key.

Details

$curl = curl_init();
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/123' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/connect-keys/123 \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/connect-keys/123",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "reseller_id": 1,
  "key": "12345678-12345678-12345678-12345678",
  "type": "premium",
  "label": "Premium Connect Key",
  "status": "active",
  "is_premium": true,
  "is_active": true,
  "coin_balance": 0,
  "first_connect": null,
  "last_connect": null,
  "created_at": "2015-05-15T14:23:29-04:00"
}

Shows details for a Connect Key, by ID.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id

Arguments

Parameter Description Type
connect_id Connect Key Id URL

Return

Returns the Connect Key object or errors if unsuccessful.

List

$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys' );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/connect-keys \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/connect-keys",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

[
  {
    "account_id": 123,
    "connect_id": 12345,
    "reseller_id": 1,
    "key": "12345678-12345678-12345678-12345678",
    "type": "premium",
    "label": "Premium Connect Key",
    "status": "active",
    "is_premium": true,
    "is_active": true,
    "coin_balance": 0,
    "first_connect": null,
    "last_connect": null,
    "created_at": "2015-05-15T14:23:29-04:00"
  },
  {
    "account_id": 123,
    "connect_id": 12346,
    "reseller_id": 1,
    "key": "12345678-12345678-12345678-12345679",
    "type": "premium",
    "label": "Premium Connect Key",
    "status": "active",
    "is_premium": true,
    "is_active": true,
    "coin_balance": 0,
    "first_connect": null,
    "last_connect": null,
    "created_at": "2015-05-15T14:23:29-04:00"
  }
]

Retrieve a list of Connect Keys for an account.

HTTP Request

https://api.boldgrid.com/v1/connect-keys

Optionally:

https://api.boldgrid.com/v1/accounts/account_id/connect-keys

Arguments

The account_id parameter is optional. If it is not passed, the currently authenticated Account will be used.

Parameter Description Type
account_id Account Id (optional) URL

Return

Returns an array of Connect Key objects or errors if unsuccessful.

Create

$data = array(
    'email' => 'user@example.com',
    'reseller_id' => 123,
    'is_premium' => 1,
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/connect-keys \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d email="user@example.com" \
    -d reseller_id="123" \
    -d is_premium="1"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/connect-keys",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "email": "user@example.com",
        "reseller_id": 123,
        "is_premium": 1
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "reseller_id": 1,
  "key": "12345678-12345678-12345678-12345678",
  "type": "premium",
  "label": "Premium Connect Key",
  "status": "active",
  "is_premium": true,
  "is_active": true,
  "coin_balance": 0,
  "first_connect": null,
  "last_connect": null,
  "created_at": "2015-05-15T14:23:29-04:00"
}

Create a new connect key for an email address. This will create a new Account object if the email does not belong to an existing user.

HTTP Request

https://api.boldgrid.com/v1/connect-keys

Arguments

Parameter Description Type
email An email address Post
reseller_id Reseller Id Post
is_premium ( optional ) Whether or not to create Premium Connect Key; pass “0” or “1” Post

Return

Returns the Connect Key object or errors if unsuccessful.

Change Subscription

$data = array(
    'type' => 'premium',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/type' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/connect-keys/12345/type \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d type="premium"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/type",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "type": "premium"
    }
} );

The above command returns JSON structured like this:

{
  "message" : "Success.",
  "connect_key" : {
    "account_id": 123,
    "connect_id": 12345,
    "reseller_id": 1,
    "key": "12345678-12345678-12345678-12345678",
    "type": "premium",
    "label": "Premium Connect Key",
    "status": "active",
    "is_premium": true,
    "is_active": true,
    "coin_balance": 0,
    "first_connect": null,
    "last_connect": null,
    "created_at": "2015-05-15T14:23:29-04:00"
  }
}

Change a Connect Key type from basic to premium and vice versa.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/type

Arguments

Parameter Description Type
connect_id Connect Key Id URL
type The new type: “basic” or “premium” Post

Return

Parameter Description
message More information regarding the request.
connect_key Connect Key object

Reissue

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/reissue' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/connect-keys/12345/reissue \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/reissue",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "reseller_id": 1,
  "key": "12345678-12345678-12345678-12345678",
  "type": "premium",
  "label": "Premium Connect Key",
  "status": "active",
  "is_premium": true,
  "is_active": true,
  "coin_balance": 0,
  "first_connect": null,
  "last_connect": null,
  "created_at": "2015-05-15T14:23:29-04:00"
}

Replace the Connect Key key value for a given Connect Id. This call is useful if user’s Connect Key has been compromised. The old value will immediately become invalid.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/reissue

Arguments

Parameter Description Type
connect_id Connect Key Id URL

Return

Returns the Connect Key object or errors if unsuccessful.

Suspend

$data = array(
    'reason' => 'non-payment',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/suspend' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/connect-keys/12345/suspend \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d reason="non-payment"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/suspend",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "reason": "non-payment"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "reseller_id": 1,
  "key": "12345678-12345678-12345678-12345678",
  "type": "premium",
  "label": "Premium Connect Key",
  "status": "suspended",
  "is_premium": true,
  "is_active": true,
  "coin_balance": 0,
  "first_connect": null,
  "last_connect": null,
  "created_at": "2015-05-15T14:23:29-04:00"
}

Mark a Connect Key as suspended.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/suspend

Arguments

Parameter Description Type
connect_id Connect Key Id URL
reason (Optional) Reason for the status change Post

Return

Returns the Connect Key object or errors if unsuccessful.

Unsuspend

$data = array(
    'reason' => 'paid',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/unsuspend' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/connect-keys/12345/unsuspend \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d reason="paid"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/unsuspend",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "reason": "paid"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "reseller_id": 1,
  "key": "12345678-12345678-12345678-12345678",
  "type": "premium",
  "label": "Premium Connect Key",
  "status": "active",
  "is_premium": true,
  "is_active": true,
  "coin_balance": 0,
  "first_connect": null,
  "last_connect": null,
  "created_at": "2015-05-15T14:23:29-04:00"
}

Mark a Connect Key as unsuspended.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/unsuspend

Arguments

Parameter Description Type
connect_id Connect Key Id URL
reason (Optional) Reason for the status change Post

Return

Returns the Connect Key object or errors if unsuccessful.

Copyright Coin

Balance

$curl = curl_init();
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/coin' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/connect-keys/12345/coin \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/coin",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
    "balance": 20
}

Retrieve the Copyright Coin balance for a Connect Key.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/coin

Arguments

Parameter Description Type
connect_id Connect Key Id URL

Return

Type Parameter Description
integer balance Copyright Coin balance

Add

$data = array(
    'coins' => 20,
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/coin' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/connect-keys/12345/coin \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d coins="20"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/coin",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "coins": 20
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "new_balance": 40,
  "old_balance": 20
}

Add Copyright Coins to a Connect Key. This action will move the requested number of coins from the authenticated reseller account, to the specified Connect Key. There must be sufficient coins in the reseller account to honor the transfer. The Connect Key must also be owned by the authenticated reseller.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/coin

Arguments

Parameter Description Type
connect_id Connect Key Id URL
coins Number of Copyright Coins to add Post

Return

Type Parameter Description
integer account_id Account ID
integer connect_id Connect Key ID
integer new_balance The new Copyright Coin balance
integer old_balance The previous Copyright Coin balance

Remove

$data = array(
    'coins' => 20,
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_CUSTOMREQUEST, 'DELETE' );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/coin' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X DELETE https://api.boldgrid.com/v1/connect-keys/12345/coin \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d coins="20"
jQuery.ajax( {
    type: "DELETE",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/coin",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "coins": 20
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "new_balance": 20,
  "old_balance": 40
}

Remove Copyright Coins from a Connect Key. This action will move the requested number of coins from the specified Connect Key, to the authenticated reseller account. There must be sufficient coins assigned to the specified Connect Key to honor the transfer. The Connect Key must also be owned by the authenticated reseller.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/coin

Arguments

Parameter Description Type
connect_id Connect Key Id URL
coins Number of Copyright Coins to remove Post

Return

Type Parameter Description
integer account_id Account ID
integer connect_id Connect Key ID
integer new_balance The new Copyright Coin balance
integer old_balance The previous Copyright Coin balance

Notification

Notifications are used when important changes are made to a user’s Account. A user can read them within BoldGrid Central.

Schema

Type Parameter Description
integer notification_id Notification ID
string subject Title
string body Content
boolean has_read Whether or not notification was read
string date_read Date the notification was read
string date_sent Date notification was sent

Details

$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/notifications/12345' );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/notifications/12345 \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/notifications/12345",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "notification_id": 124,
  "subject": "Connect Key Replaced 3",
  "body": "<p>Notification HTML</p>",
  "has_read": true,
  "date_read": "2016-12-28T10:43:58-05:00",
  "date_sent": "2016-12-23T10:43:58-05:00"
}

Shows details for a Notification, by ID.

HTTP Request

https://api.boldgrid.com/v1/notifications/notification_id

Arguments

Parameter Description Type
notification_id Notification Id URL

Return

Returns a Notifications object or error if unsuccessful.

List

$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/notifications' );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/notifications \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/notifications",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

[
  {
    "notification_id": 123,
    "subject": "Connect Key Replaced 2",
    "body": "<p>Notification HTML</p>",
    "has_read": false,
    "date_read": null,
    "date_sent": "2016-12-23T10:43:58-05:00"
  },
  {
    "notification_id": 124,
    "subject": "Connect Key Replaced 3",
    "body": "<p>Notification HTML</p>",
    "has_read": true,
    "date_read": "2016-12-28T10:43:58-05:00",
    "date_sent": "2016-12-23T10:43:58-05:00"
  }
]

List notifications for an Account. If no Account is specified, the authorized Account will be used.

HTTP Request

https://api.boldgrid.com/v1/notifications

Optionally:

https://api.boldgrid.com/v1/accounts/account_id/notifications

Arguments

Parameter Description Type
account_id Account Id (optional) URL

Return

Returns array of Notifications objects or errors if unsuccessful.

Unread Count

$curl = curl_init();
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/notifications/unread' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/notifications/unread \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/notifications/unread",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "count" : 2
}

Get a count of notifications that have not been read yet. If no Account is specified, the authorized Account will be used.

HTTP Request

https://api.boldgrid.com/v1/notifications/unread

Optionally:

https://api.boldgrid.com/v1/accounts/account_id/notifications/unread

Arguments

Parameter Description Type
account_id Account Id (optional) URL

Return

Type Parameter Description
integer count Number of unread notifications

Mark As Read

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/account/notification/12345/read' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/account/notification/12345/read \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/notification/12345/read",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "notification_id": 124,
  "subject": "Connect Key Replaced 3",
  "body": "<p>Notification HTML</p>",
  "has_read": true,
  "date_read": "2016-12-28T10:43:58-05:00",
  "date_sent": "2016-12-23T10:43:58-05:00"
}

Mark a Notification ID as read.

HTTP Request

https://api.boldgrid.com/v1/notifications/notification_id/read

Arguments

Parameter Description Type
notification_id Notification Id URL

Return

Returns Notification object or errors if unsuccessful.

Plugin

Retrieve information about any of the BoldGrid recommended plugins. Authentication is optional, but if you would like to access premium plugin URLs you will need to provide an authorization token.

Schema

Type Parameter Description
string name Name of the plugin
string slug Slug for the plugin
string sections/description A short description of the plugin
string homepage URL to the plugins marketing page
string versions A list of available plugin download urls
string versions/trunk Stable version of the plugin, wporg url if available
string versions/candidate Development version of the plugin, only for BoldGrid plugins.
string versions/edge Release Candidate version of the plugin, only for BoldGrid plugins.
string versions/stable Stable version of the plugin, only for BoldGrid plugins.
string assets Branding Images
string assets/icon_normal Normal Icon
string assets/icon_high_dpi Large Icon
string assets/banner_normal Normal Banner
string assets/banner_high_dpi Large Banner
string links Plugin related links
string links/github URL to the plugins github page
string links/wporg URL to the plugin page on wordpress.org
string links/api_resource URL to the api resource.

Details

$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/plugins/post-and-page-builder' );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/plugins/post-and-page-builder \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/plugins/post-and-page-builder",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "name":"Post and Page Builder",
  "slug":"post-and-page-builder",
  "sections":{
    "description":"The BoldGrid Post and Page Builder plugin allows you to drag and drop content, rows, and columns to create beautiful pages with rich layouts easily, and without shortcodes."
  },
  "homepage":"https://www.boldgrid.com/boldgrid-editor",
  "versions": {
    "trunk":"https://downloads.wordpress.org/plugin/post-and-page-builder.zip",
    "candidate":"https://downloads.wordpress.org/plugin/post-and-page-builder.1.6.zip",
    "edge":"https://downloads.wordpress.org/plugin/post-and-page-builder.1.4.5.zip",
    "stable":"https://downloads.wordpress.org/plugin/post-and-page-builder.1.6.zip"
  },
  "assets": {
    "icon_normal":"https://ps.w.org/post-and-page-builder/assets/icon-128x128.png",
    "icon_high_dpi":"https://ps.w.org/post-and-page-builder/assets/icon-256x256.png",
    "banner_normal":"https://ps.w.org/post-and-page-builder/assets/banner-772x250.png",
    "banner_high_dpi":"https://ps.w.org/post-and-page-builder/assets/banner-1544x500.png"
  },
  "links": {
    "github":"https://github.com/BoldGrid/post-and-page-builder",
    "wporg":"https://wordpress.org/plugins/post-and-page-builder",
    "api_resource":"https://api.boldgrid.com/v1/plugins/post-and-page-builder"
  }
}

Shows details for a plugin, by slug.

HTTP Request

https://api.boldgrid.com/v1/plugins/slug

Arguments

Parameter Description Type
slug Plugin slug URL

Return

Returns a Plugin object or error if unsuccessful.

List

$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/plugins' );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/plugins \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/plugins",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

[
{
  "name":"Post and Page Builder",
  "slug":"post-and-page-builder",
  "sections":{
    "description":"The BoldGrid Post and Page Builder plugin allows you to drag and drop content, rows, and columns to create beautiful pages with rich layouts easily, and without shortcodes."
  },
  "homepage":"https://www.boldgrid.com/boldgrid-editor",
  "versions": {
    "trunk":"https://downloads.wordpress.org/plugin/post-and-page-builder.zip",
    "candidate":"https://downloads.wordpress.org/plugin/post-and-page-builder.1.6.zip",
    "edge":"https://downloads.wordpress.org/plugin/post-and-page-builder.1.4.5.zip",
    "stable":"https://downloads.wordpress.org/plugin/post-and-page-builder.1.6.zip"
  },
  "assets": {
    "icon_normal":"https://ps.w.org/post-and-page-builder/assets/icon-128x128.png",
    "icon_high_dpi":"https://ps.w.org/post-and-page-builder/assets/icon-256x256.png",
    "banner_normal":"https://ps.w.org/post-and-page-builder/assets/banner-772x250.png",
    "banner_high_dpi":"https://ps.w.org/post-and-page-builder/assets/banner-1544x500.png"
  },
  "links": {
    "github":"https://github.com/BoldGrid/post-and-page-builder",
    "wporg":"https://wordpress.org/plugins/post-and-page-builder",
    "api_resource":"https://api.boldgrid.com/v1/plugins/post-and-page-builder"
  }
},
{
  "name":"BoldGrid Easy SEO",
  "slug":"boldgrid-easy-seo",
  "sections":{
    "description":"BoldGrid SEO will help your website rank in search engines and get noticed by grading your page content for target keywords and providing easy meta data management."
  },
  "homepage":"https://www.boldgrid.com/boldgrid-seo",
  "versions": {
    "trunk":"https://downloads.wordpress.org/plugin/boldgrid-easy-seo.zip",
    "candidate":"https://downloads.wordpress.org/plugin/boldgrid-easy-seo.1.6.zip",
    "edge":"https://downloads.wordpress.org/plugin/boldgrid-easy-seo.1.6.zip",
    "stable":"https://downloads.wordpress.org/plugin/boldgrid-easy-seo.1.6.zip"
  },
  "assets": {
    "icon_normal":"https://ps.w.org/boldgrid-easy-seo/assets/icon-128x128.png",
    "icon_high_dpi":"https://ps.w.org/boldgrid-easy-seo/assets/icon-256x256.png",
    "banner_normal":"https://ps.w.org/boldgrid-easy-seo/assets/banner-772x250.png",
    "banner_high_dpi":"https://ps.w.org/boldgrid-easy-seo/assets/banner-1544x500.png"
  },
  "links": {
    "github":"https://github.com/BoldGrid/boldgrid-seo",
    "wporg":"https://wordpress.org/plugins/boldgrid-easy-seo",
    "api_resource":"https://api.boldgrid.com/v1/plugins/boldgrid-easy-seo"
  }
},
]

List all BoldGrid recommended plugins.

HTTP Request

https://api.boldgrid.com/v1/plugins

Return

Returns an array of Plugin objects or error if unsuccessful.

Report

Connect Keys

$data = array(
    'date_from' => 'YYYY-MM-DD',
    'date_to' => 'YYYY-MM-DD',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/resellers/123/reports/connect-keys' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/resellers/123/reports/connect-keys \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d date_from="YYYY-MM-DD" \
    -d date_to="YYYY-MM-DD"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/resellers/123/reports/connect-keys",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "date_from": "YYYY-MM-DD",
        "date_to": "YYYY-MM-DD"
    }
} );

The above command returns JSON structured like this:

{
  "date_range": {
    "date_from": "2016-02-09T00:00:00-0500",
    "date_to": "2016-02-10T23:59:59-0500"
  },
  "connect_keys": [
    {
      "connect_id": "1234",
      "account_id": "123456",
      "is_premium": "0",
      "current_status": "active",
      "api_key": "45642d14-baa8d5ec-efec7dbb-XXXXXXXX",
      "is_active": "1",
      "coin_balance": "0",
      "first_connect": "2016-02-09T07:39:44-0500",
      "last_connect": "2016-02-09T08:03:29-0500",
      "created_at": "2016-02-09T06:04:31-0500"
    },
    {
      "connect_id": "2345",
      "account_id": "234567",
      "is_premium": "1",
      "current_status": "active",
      "api_key": "add6eaea-521a1212-075eba45-XXXXXXXX",
      "is_active": "1",
      "coin_balance": "10",
      "first_connect": "2016-02-09T09:12:52-0500",
      "last_connect": "2016-02-09T10:42:23-0500",
      "created_at": "2016-02-09T08:32:14-0500"
    }
  ]
}

Retrieve a list of Connect keys. Date ranges are optional.

HTTP Request

https://api.boldgrid.com/v1/resellers/reseller_id/reports/connect-keys

Arguments

Parameter Description Type
reseller_id Reseller Id URL
date_from An optional start date Post
date_to An optional end date Post

Return

Element Path Parameter Description
/date_range date_from Input start date.
/date_range date_to Input end date.
/connecy_keys connect_id Connect Key id.
/connect_keys account_id Account id.
/connect_keys is_premium Whether or not the Connect Key is considered Premium.
/connect_keys current_status Current status of the Connect Key.
/connect_keys api_key A Connect Key.
/connect_keys is_active Whether or not the Connect Key is active.
/connect_keys coin_balance Copyright Coin balance.
/connect_keys first_connect Timestamp when a user first requested a preview build in the Inspiration process.
/connect_keys last_connect Timestamp of the last API connection.
/connect_keys created_at Timestamp of the creation of the Connect Key.

Reseller

Schema

Parameter Description
account_id Account ID.
connect_id Connect Key ID.
reseller_id Reseller ID.
title Reseller title/name.
logo_url URL address for a logo to display in WordPress.
website_url URL address for the reseller’s website.
support_url URL address for the reseller’s support website.
support_url_title Label to use for the support url.
cp_url URL address for the reseller’s customer control panel.
cp_url_title Label to use for the customer control panel url.
email An email address.
phone An optional phone number for customers to contact the reseller.
enabled_coin_sale Whether or not this reseller has enabled sale of coins.
enabled_key_sale Whether or not this reseller has enabled sale of keys.

Details

$curl = curl_init();
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/resellers/123' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/resellers/123 \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/resellers/123",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "reseller_id": 123,
  "title": "Reseller Company Title",
  "website_url": "https://www.testing.com",
  "logo_url": "https://www.logo-url.com/logo.png",
  "support_url": "https://www.example.com/support",
  "support_url_title": "Support Center",
  "cp_url": "https://www.example.com/portal",
  "cp_url_title": "Account Management",
  "phone": "777-777-7777",
  "email": "test@example.com",
  "enabled_key_sale": false,
  "enabled_coin_sale": false
}

Shows details for a Reseller, by ID.

HTTP Request

https://api.boldgrid.com/v1/resellers/reseller_id

Arguments

Parameter Description Type
reseller_id Reseller Id URL

Return

Returns the Reseller object or errors if unsuccessful.

Create

$data = array(
    'title' => 'Example Hosting Company',
    'logo_url' => 'https://www.example.com/logo.png',
    'website_url' => 'https://www.example.com/',
    'support_url' => 'https://www.example.com/support',
    'cp_url' => 'https://www.example.com/portal',
    'email' => 'user@example.com',
    'phone' => '1-555-555-5555',
    'is_premium' => '1',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/resellers/12345' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/resellers/12345 \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d title="Example Hosting Company" \
    -d logo_url="https://www.example.com/logo.png" \
    -d website_url="https://www.example.com/" \
    -d support_url="https://www.example.com/support" \
    -d cp_url="https://www.example.com/portal" \
    -d email="user@example.com" \
    -d phone="1-555-555-5555" \
    -d is_premium="1"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/resellers/12345",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "title" : "Example Hosting Company",
        "logo_url" : "https://www.example.com/logo.png",
        "website_url" : "https://www.example.com/",
        "support_url" : "https://www.example.com/support",
        "cp_url" : "https://www.example.com/portal",
        "email" : "user@example.com",
        "phone" : "1-555-555-5555",
        "is_premium": "1"
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "reseller_id": 123,
  "title": "Reseller Company Title",
  "website_url": "https://www.testing.com",
  "logo_url": "https://www.logo-url.com/logo.png",
  "support_url": "https://www.example.com/support",
  "support_url_title": "Support Center",
  "cp_url": "https://www.example.com/portal",
  "cp_url_title": "Account Management",
  "phone": "777-777-7777",
  "email": "test@example.com",
  "enabled_key_sale": false,
  "enabled_coin_sale": false
}

Create a sub-reseller account and Connect Key.

HTTP Request

https://api.boldgrid.com/v1/resellers/reseller_id

Arguments

Parameter Description Type
reseller_id Reseller Id URL
title Reseller title/name Post
logo_url An optional URL address for a logo to display in WordPress Post
website_url An optional URL address for the reseller’s website Post
support_url An optional URL address for the reseller’s support website Post
cp_url An optional URL address for the reseller’s customer control panel Post
email An email address Post
phone An optional phone number for customers to contact the reseller Post
is_premium An optional parameter to create a Premium Connect Key; pass “0” or “1” Post

Return

Returns a Reseller object or errors if failure.

Update

$data = array(
    'title' => 'Example Hosting Company',
    'logo_url' => 'https://www.example.com/logo.png',
    'website_url' => 'https://www.example.com/',
    'support_url' => 'https://www.example.com/support',
    'support_url_title' => 'Support Center',
    'cp_url' => 'https://www.example.com/portal',
    'cp_url_title' => 'Host Portal',
    'email' => 'user@example.com',
    'phone' => '1-555-555-5555',
    'enabled_key_sale' => 1,
    'enabled_coin_sale' => 0,
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_CUSTOMREQUEST, 'PUT' );
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/resellers/123' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X PUT https://api.boldgrid.com/v1/resellers/123 \
    -H "Authorization: Bearer ACCESS_TOKEN" \
    -d title="Example Hosting Company" \
    -d logo_url="https://www.example.com/logo.png" \
    -d website_url="https://www.example.com/" \
    -d support_url="https://www.example.com/support" \
    -d support_url_title="Support Center" \
    -d cp_url="https://www.example.com/portal" \
    -d cp_url_title="Host Portal" \
    -d email="user@example.com" \
    -d phone="1-555-555-5555" \
    -d enabled_key_sale="1" \
    -d enabled_coin_sale="0"
jQuery.ajax( {
    type: "PUT",
    url: "https://api.boldgrid.com/v1/resellers/123",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    },
    data: {
        "title" : "Example Hosting Company",
        "logo_url" : "https://www.example.com/logo.png",
        "website_url" : "https://www.example.com/",
        "support_url" : "https://www.example.com/support",
        "support_url_title" : "Support Center",
        "cp_url" : "https://www.example.com/portal",
        "cp_url_title" : "Host Portal",
        "email" : "user@example.com",
        "phone" : "1-555-555-5555",
        "enabled_key_sale" : 1,
        "enabled_coin_sale" : 0
    }
} );

The above command returns JSON structured like this:

{
  "account_id": 123,
  "connect_id": 12345,
  "reseller_id": 123,
  "title": "Reseller Company Title",
  "website_url": "https://www.testing.com",
  "logo_url": "https://www.logo-url.com/logo.png",
  "support_url": "https://www.example.com/support",
  "support_url_title": "Support Center",
  "cp_url": "https://www.example.com/portal",
  "cp_url_title": "Account Management",
  "phone": "777-777-7777",
  "email": "test@example.com",
  "enabled_key_sale": false,
  "enabled_coin_sale": false
}

Update Reseller settings

HTTP Request

https://api.boldgrid.com/v1/resellers/reseller_id

Arguments

Parameter Description Type
reseller_id Reseller Id URL
title Reseller title/name Query
logo_url URL address for a logo to display in WordPress Query
website_url URL address for the reseller’s website Query
support_url URL address for the reseller’s support website Query
support_url_title Label to use for the support URL address Query
cp_url URL address for the reseller’s customer control panel Query
cp_url_title Label to use for the customer control panel URL address Query
email An email address Query
phone An optional phone number for customers to contact the reseller Query
enabled_coin_sale Whether or not this reseller has enabled sale of coins Query
enabled_key_sale Whether or not this reseller has enabled sale of keys Query

Return

Returns an updated Reseller object or errors if failure.

Site

A Site object represents the user WordPress website that has been connected to the BoldGrid API using a Connect Key.

Schema

Type Parameter Description
integer site_id Identifier for this site
string site_name Site’s friendly name based on the URL address
string first_connect Timestamp when a user first connected the Connect Key to the site
string last_connect Timestamp when a user last connected to the API
string first_login Timestamp of the first login
string last_login Timestamp of the latest login

Details

$curl = curl_init();
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/sites/123' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/connect-keys/12345/sites/123 \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/sites/123",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

{
    "site_id": 123,
    "site_name": "test-site1.com",
    "first_connect": "2015-05-27T12:41:12-04:00",
    "last_connect": "2015-05-27T12:41:12-04:00",
    "first_login": null,
    "last_login": null,
    "token": "Vk00Q3pnZWk1UjZJejYvVk5lWXFzZldpdXoxczhxbjl3alVwVDhEblJIdHora2ozSzAzU2R5cWYyYTNSc29vNy9mN29FK2ZOeTB5bXh6aVAweE80ZlBxQ2hPdlBxR2lHVzJnTW52SGVMdE4yK1eyUUNYMlozNXe5VDBWQ2J0Unpsb3JEVkw1SE5WNXl4Rml4VjkrRGJnPT0::l9nuegZrm1VJMp5-W8a7ZQ"
}

Retrieve a site resource object.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/sites/site_id

Arguments

Parameter Description Type
connect_id Connect Key Id URL
site_id Site Id URL

Return

Returns Site object including a login token, or errors if unsuccessful.

List

$curl = curl_init();
curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Authorization: Bearer ACCESS_TOKEN' ) );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/sites' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -G https://api.boldgrid.com/v1/connect-keys/12345/sites \
    -H "Authorization: Bearer ACCESS_TOKEN"
jQuery.ajax( {
    type: "GET",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/sites",
    headers: {
        "Authorization": "Bearer ACCESS_TOKEN"
    }
} );

The above command returns JSON structured like this:

[
  {
    "site_id": 122,
    "site_name": "test-site0.com",
    "first_connect": "2016-12-21T15:33:07+00:00",
    "last_connect": "2017-03-10T10:58:04+00:00",
    "first_login": "2016-12-21T14:58:20+00:00",
    "last_login": "2017-03-10T09:45:30+00:00"
  },
  {
    "site_id": 123,
    "site_name": "test-site1.com",
    "first_connect": "2016-12-22T15:33:07+00:00",
    "last_connect": "2017-01-143T11:52:08+00:00",
    "first_login": null,
    "last_login": null
  }
]

Retrieve a list of sites where the given Connect Key is used.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/sites

Arguments

Parameter Description Type
connect_id Connect Key Id URL

Return

Returns Site objects or errors if unsuccessful.

Validate Token

$data = array(
    'key' => '50bd2879cbeeg87272626df34a5dd409a',
    'token' => 'Vk00Q3pnZWk1UjZJejYvVk5lWXFzZldpdXoxczhxbjl3alVwVDhEblJIdHora2ozSzAzU2R5cWYyYTNSc29vNy9mN29FK2ZOeTB5bXh6aVAweE80ZlBxQ2hPdlBxR2lHVzJnTW52SGVMdE4yK1eyUUNYMlozNXe5VDBWQ2J0Unpsb3JEVkw1SE5WNXl4Rml4VjkrRGJnPT0::l9nuegZrm1VJMp5-W8a7ZQ',
);

$curl = curl_init();
curl_setopt( $curl, CURLOPT_POST, 1 );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_URL, 'https://api.boldgrid.com/v1/connect-keys/12345/sites/123/token' );
$result = curl_exec( $curl );
curl_close( $curl );

print_r( $result );
exit();
curl -X POST https://api.boldgrid.com/v1/connect-keys/12345/sites/123/token \
    -d key=50bd2879cbeeg87272626df34a5dd409a \
    -d token="Vk00Q3pnZWk1UjZJejYvVk5lWXFzZldpdXoxczhxbjl3alVwVDhEblJIdHora2ozSzAzU2R5cWYyYTNSc29vNy9mN29FK2ZOeTB5bXh6aVAweE80ZlBxQ2hPdlBxR2lHVzJnTW52SGVMdE4yK1eyUUNYMlozNXe5VDBWQ2J0Unpsb3JEVkw1SE5WNXl4Rml4VjkrRGJnPT0::l9nuegZrm1VJMp5-W8a7ZQ"
jQuery.ajax( {
    type: "POST",
    url: "https://api.boldgrid.com/v1/connect-keys/12345/sites/123/token",
    data: {
        "key": "50bd2879cbeeg87272626df34a5dd409a",
        "token": "Vk00Q3pnZWk1UjZJejYvVk5lWXFzZldpdXoxczhxbjl3alVwVDhEblJIdHora2ozSzAzU2R5cWYyYTNSc29vNy9mN29FK2ZOeTB5bXh6aVAweE80ZlBxQ2hPdlBxR2lHVzJnTW52SGVMdE4yK1eyUUNYMlozNXe5VDBWQ2J0Unpsb3JEVkw1SE5WNXl4Rml4VjkrRGJnPT0::l9nuegZrm1VJMp5-W8a7ZQ"
    }
} );

The above command returns JSON structured like this:

{
     "validated": true
}

Validate a site login token.

HTTP Request

https://api.boldgrid.com/v1/connect-keys/connect_id/sites/site_id/token

Arguments

Parameter Description Type
connect_id Connect Key Id URL
site_id Site Id URL
key Connect Key hash Post
token Token string Post

Return

Returns a JSON-encoded string indicating success, or errors if unsuccessful.

Errors

The BoldGrid API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request was invalid.
401 Unauthorized – Your API key or token was invalid.
403 Forbidden – You were not permitted to perform that request.
404 Not Found – The specified request url could not be found.
405 Method Not Allowed – The request method is not allowed.
406 Not Acceptable – You requested a format that isn’t correct.
410 Gone – The url requested has been removed from our servers.
412 Precondition Failed – A precondition was not met. Reevaluate the request.
422 Unprocessable Entity – The operation could not be completed due to the state of an entity.
429 Too Many Requests – You have exceeded that request limit.
500 Internal Server Error – We had a problem with our server. Try again later.
502 Bad Gateway – The HTTP gateway failed. Please try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.
504 Gateway Timeout – The HTTP gateway timed-out. Please try again later.