Create a Meraki REST API wrapper for the http servers (webhooks) ressource. See the online documentation for more information.
- Source:
Example
const apiKey = 'secret meraki api key'
const organizationId = 'meraki organization id'
const version = 'v0'
const target = 'n12'
const basePath = `/${target}/${version}/network`
const rateLimiter = {
enabled: true
}
const httpServersEndpoints = require('./lib/rest/httpServers')({ apiKey, target, basePath, baseUrl, rateLimiter, logger })
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
apiKey |
string |
<optional> |
''
|
The Meraki api key |
target |
string |
<optional> |
'api'
|
The Meraki target |
basePath |
string |
<optional> |
'/'
|
The Meraki base path for the ressource |
baseUrl |
string |
<optional> |
'https://api.meraki.com'
|
The Meraki base url for the ressource |
rateLimiter |
string | The rate limiter (bottleneck) configuration |
Returns:
The initialized Meraki REST API wrapper for the http server (webhook) ressource
- Type
- Object
Methods
(static) addHTTPServer(apiKeyopt, targetopt, scopeopt, networkId, webhook) → {Promise}
- Source:
Add a http server.
Examples
Example request data
{
"name": "My HTTP server",
"url": "https://www.example.com/webhooks",
"sharedSecret": "foobar"
}
Example response
{
"id": "ABC123",
"networkId": "N_123",
"name": "My HTTP server",
"url": "https://www.example.com/webhooks",
"sharedSecret": "foobar"
}
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiKey |
string |
<optional> |
Optional custom apiKey for this request (if not set will take the inital apiKey) |
||||||||||||
target |
string |
<optional> |
Optional custom target for this request (if not set will take the inital target) |
||||||||||||
scope |
string |
<optional> |
Optional custom scope for rate limiter |
||||||||||||
networkId |
string | The id of the network |
|||||||||||||
webhook |
object | The webhook (http server) itself Properties
|
Returns:
A promise holding the webhook (http server)
- Type
- Promise
(static) deleteHTTPServer(apiKeyopt, targetopt, scopeopt, networkId, webhookId) → {Promise}
- Source:
Delete a http servers of a network.
Example
Example response
(empty)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
apiKey |
string |
<optional> |
Optional custom apiKey for this request (if not set will take the inital apiKey) |
target |
string |
<optional> |
Optional custom target for this request (if not set will take the inital target) |
scope |
string |
<optional> |
Optional custom scope for rate limiter |
networkId |
string | The id of the network |
|
webhookId |
string | The id of the webhook (http server) |
Returns:
A promise holding nothing
- Type
- Promise
(static) getHTTPServer(apiKeyopt, targetopt, scopeopt, networkId, webhookId) → {Promise}
- Source:
Get a http servers of a network.
Example
Example response
{
"id": "ABC123",
"networkId": "N_123",
"name": "My HTTP server",
"url": "https://www.example.com/webhooks",
"sharedSecret": "foobar"
}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
apiKey |
string |
<optional> |
Optional custom apiKey for this request (if not set will take the inital apiKey) |
target |
string |
<optional> |
Optional custom target for this request (if not set will take the inital target) |
scope |
string |
<optional> |
Optional custom scope for rate limiter |
networkId |
string | The id of the network |
|
webhookId |
string | The id of the webhook (http server) |
Returns:
A promise holding the http server of this network
- Type
- Promise
(static) getWebhookTestStatus(apiKeyopt, targetopt, scopeopt, networkId, webhookTestId) → {Promise}
- Source:
Return the status of a webhook test.
Example
Example response
{
"id": "1234",
"url": "https://www.example.com/path",
"status": "enqueued"
}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
apiKey |
string |
<optional> |
Optional custom apiKey for this request (if not set will take the inital apiKey) |
target |
string |
<optional> |
Optional custom target for this request (if not set will take the inital target) |
scope |
string |
<optional> |
Optional custom scope for rate limiter |
networkId |
string | The id of the network for which to list the http servers |
|
webhookTestId |
string | The id of the test |
Returns:
A promise holding the status of this test
- Type
- Promise
(static) listHTTPServers(apiKeyopt, targetopt, scopeopt, networkId) → {Promise}
- Source:
List the http servers for a network.
Example
Example response
[
{
"id": "ABC123",
"networkId": "N_123",
"name": "My HTTP server",
"url": "https://www.example.com/webhooks",
"sharedSecret": "foobar"
}
]
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
apiKey |
string |
<optional> |
Optional custom apiKey for this request (if not set will take the inital apiKey) |
target |
string |
<optional> |
Optional custom target for this request (if not set will take the inital target) |
scope |
string |
<optional> |
Optional custom scope for rate limiter |
networkId |
string | The id of the network for which to list the http servers |
Returns:
A promise holding the http servers for this network
- Type
- Promise
(static) sendTestWebhook(apiKeyopt, targetopt, scopeopt, networkId, url) → {Promise}
- Source:
send a test webhook.
Examples
Example request data
{
"url": "https://www.example.com/webhooks"
}
Example response
{
"id": "1234",
"url": "https://www.example.com/path",
"status": "enqueued"
}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
apiKey |
string |
<optional> |
Optional custom apiKey for this request (if not set will take the inital apiKey) |
target |
string |
<optional> |
Optional custom target for this request (if not set will take the inital target) |
scope |
string |
<optional> |
Optional custom scope for rate limiter |
networkId |
string | The id of the network |
|
url |
string | The url where the webhook should be sent to |
Returns:
A promise holding the webhook test
- Type
- Promise
(static) updateHTTPServer(apiKeyopt, targetopt, scopeopt, networkId, webhookId, webhook) → {Promise}
- Source:
Update http server.
Examples
Example request data
{
"name": "My HTTP server",
"url": "https://www.example.com/webhooks",
"sharedSecret": "foobar"
}
Example response
{
"id": "ABC123",
"networkId": "N_123",
"name": "My HTTP server",
"url": "https://www.example.com/webhooks",
"sharedSecret": "foobar"
}
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiKey |
string |
<optional> |
Optional custom apiKey for this request (if not set will take the inital apiKey) |
||||||||||||
target |
string |
<optional> |
Optional custom target for this request (if not set will take the inital target) |
||||||||||||
scope |
string |
<optional> |
Optional custom scope for rate limiter |
||||||||||||
networkId |
string | The id of the network |
|||||||||||||
webhookId |
string | The id of the webhook (http server) |
|||||||||||||
webhook |
object | The webhook (http server) itself Properties
|
Returns:
A promise holding the updated webhook (http server)
- Type
- Promise