Webhook Credentials

Get and create Webhook credential hashes.

Retrieve a list of OAuth2 credentials

Retrieve a list of OAuth2 credentials.

Request
Security:
header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200A list of OAuth2 credentials was retrieved successfully.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
get/credential-hashes/oauth2
Request samples
curl -i -X GET \
  https://api-sandbox.rebilly.com/credential-hashes/oauth2 \
  -H 'Organization-Id: 4f6cf35x-2c4y-483z-a0a9-158621f77a21' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
[
  • {
    }
]

Create OAuth2 credential

Begins the creation of an OAuth2 credential that can be re-used within. webhooks. The result will be a RedirectUrl that the user must authenticate and authorize Rebilly to receive the credentials.

Request
Security:
header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

OAuth2 credential resource.

status
string

The credential status.

Enum: "active" "deactivated"
service
required
string

The name of service that the OAuth2 credential belongs to.

Value: "google-sheets"
code
required
string

The OAuth2 code provided by the authentication server.

scopes
required
Array of strings

The OAuth2 granted list access.

Responses
201OAuth2 credential was created.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
422Invalid data was sent.
post/credential-hashes/oauth2
Request samples
application/json
{}
Response samples
application/json
{
  • "hash": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "active",
  • "deactivationTime": "2019-08-24T14:15:22Z",
  • "service": "google-sheets",
  • "code": "2/smAHUUr9jOxw_IOp47Y_dH1r2Y",
  • "accessToken": "zw34.PltIPtJZHmEgZS9R4RoGpzaRrJd5MYjZIONQ2MjWSCj7N7Iqp9BXXFIbkhDRfAPs6cB1pKtTjLUgb3ofzgHUprJfnRiMDTnB_yPMK7vtgobCX4SUs7fhrR6bdApq",
  • "refreshToken": "2/4DPERp2EiySF6JUIOTS4jM5f0JmLG2gPcpGaWYTGU94",
  • "_links": [
    ]
}

Retrieve an OAuth2 credential

Retrieve an OAuth2 credential with specified token identifier string.

Request
Security:
path Parameters
hash
required
string

The token identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200OAuth2 credential was retrieved successfully.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
404Resource was not found.
get/credential-hashes/oauth2/{hash}
Request samples
curl -i -X GET \
  https://api-sandbox.rebilly.com/credential-hashes/oauth2/:hash \
  -H 'Organization-Id: 4f6cf35x-2c4y-483z-a0a9-158621f77a21' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
{
  • "hash": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "active",
  • "deactivationTime": "2019-08-24T14:15:22Z",
  • "service": "google-sheets",
  • "code": "2/smAHUUr9jOxw_IOp47Y_dH1r2Y",
  • "accessToken": "zw34.PltIPtJZHmEgZS9R4RoGpzaRrJd5MYjZIONQ2MjWSCj7N7Iqp9BXXFIbkhDRfAPs6cB1pKtTjLUgb3ofzgHUprJfnRiMDTnB_yPMK7vtgobCX4SUs7fhrR6bdApq",
  • "refreshToken": "2/4DPERp2EiySF6JUIOTS4jM5f0JmLG2gPcpGaWYTGU94",
  • "_links": [
    ]
}

Update an OAuth2 credential with specified token identifier string

Update an OAuth2 credential with specified token identifier string.

Request
Security:
path Parameters
hash
required
string

The token identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

OAuth2 credential resource.

status
string

The credential status.

Enum: "active" "deactivated"
service
required
string

The name of service that the OAuth2 credential belongs to.

Value: "google-sheets"
code
required
string

The OAuth2 code provided by the authentication server.

scopes
required
Array of strings

The OAuth2 granted list access.

Responses
200OAuth2 credential was updated.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
404Resource was not found.
409Conflict.
422Invalid data was sent.
patch/credential-hashes/oauth2/{hash}
Request samples
application/json
{}
Response samples
application/json
{
  • "hash": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "active",
  • "deactivationTime": "2019-08-24T14:15:22Z",
  • "service": "google-sheets",
  • "code": "2/smAHUUr9jOxw_IOp47Y_dH1r2Y",
  • "accessToken": "zw34.PltIPtJZHmEgZS9R4RoGpzaRrJd5MYjZIONQ2MjWSCj7N7Iqp9BXXFIbkhDRfAPs6cB1pKtTjLUgb3ofzgHUprJfnRiMDTnB_yPMK7vtgobCX4SUs7fhrR6bdApq",
  • "refreshToken": "2/4DPERp2EiySF6JUIOTS4jM5f0JmLG2gPcpGaWYTGU94",
  • "_links": [
    ]
}

Retrieve a list of root items available for specified credential

Retrieve a list of root items available for specified credential.

Request
Security:
path Parameters
hash
required
string

The token identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200A list of root items available for specified credential was retrieved. successfully.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
get/credential-hashes/oauth2/{hash}/items
Request samples
curl -i -X GET \
  https://api-sandbox.rebilly.com/credential-hashes/oauth2/:hash/items \
  -H 'Organization-Id: 4f6cf35x-2c4y-483z-a0a9-158621f77a21' \
  -H 'REB-APIKEY: YOUR_API_KEY_HERE'
Response samples
application/json
[
  • {
    }
]

Create a webhook credential

Create a webhook credential.

Request
Security:
header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Credential resource.

status
string

The credential status.

Enum: "active" "deactivated"
host
required
string

The host name.

object (WebhookAuthorization)
type
required
string
Default: "none"

The authorization type.

Responses
201Webhook credential was created.
303An existent Webhook credential was retrieved.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
422Invalid data was sent.
post/credential-hashes/webhooks
Request samples
application/json
{
  • "status": "active",
  • "host": "string",
  • "auth": {
    }
}
Response samples
application/json
{
  • "hash": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "active",
  • "deactivationTime": "2019-08-24T14:15:22Z",
  • "host": "string",
  • "auth": {
    }
}

Retrieve a webhook credential

Retrieve a webhook credential with specified token identifier string.

Request
Security:
path Parameters
hash
required
string

The token identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200Webhook credential was retrieved successfully.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
404Resource was not found.
get/credential-hashes/webhooks/{hash}
Request samples
const details = await api.credentialHashes.getWebhookCredential({hash: 'foobar-001'});
console.log(details.fields.host);
Response samples
application/json
{
  • "hash": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "active",
  • "deactivationTime": "2019-08-24T14:15:22Z",
  • "host": "string",
  • "auth": {
    }
}

Update a webhook credential

Update a webhook credential with specified token identifier string.

Request
Security:
path Parameters
hash
required
string

The token identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Webhook credential resource.

status
required
string

The credential status.

Value: "deactivated"
Responses
200Webhook credential was updated successfully.
401Unauthorized access, invalid credentials was used.
403Access forbidden.
404Resource was not found.
422Invalid data was sent.
patch/credential-hashes/webhooks/{hash}
Request samples
application/json
{
  • "status": "deactivated"
}
Response samples
application/json
{
  • "hash": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "status": "active",
  • "deactivationTime": "2019-08-24T14:15:22Z",
  • "host": "string",
  • "auth": {
    }
}