Create a Webhook Collector

Create a Webhook Collector

Using this Collector you can input single or multi-line events over https into DigitalStakeout. Applications can send an HTTP request to the DigitalStakeout endpoint and DigitalStakeout will convert it into an event for subsequent processing. This Monitor can be used to receive webhook requests from other services and applications.

Navigate to a page where you can select "Add Monitor."

When the menu appears, select "Webhook Collector."

When the "Create Webhook Collector" menu appears, adjust the fields as you wish. The name field is mandatory; name the monitor as you wish provided said name is a minimum of three characters.

You will be presented two fields, API Key & API Secret. These two read-only fields are the credentials you will require to successfully post data to this index.

When you are finished, select "Save."

After saving your Webhook Collector, your keys will be ready to accept data at https://input.digitalstakeout.com/insert


Notes About the Monitor:
  1. Keep your API Token & API Secret private at all times.
  2. HTTP POST is only supported.
  3. The Header must be set to Content-Type: application/json.
  4. The API endpoint will either return a 429 (busy) error if your application exceeds a rate limit of 5 posts per second over 5 mins.
  5. Do NOT use a / at the end of https://input.digitalstakeout.com/insert, you will receive a 404 not found response.
  6. The maximum size for your message payload must be less than 16,384 characters.
  7. Scout will process your content just like any data from other Monitors.
Example Post to Monitor:

For your example to work, you will need to create a Webhook Collector and use the token (X) and secret (Y) values.

Authorization bearer  (TokenSecret) is a concatenated string of token + secret.

Example:


Token=AdvYIPoDY7HX1

Secret=aiVgusJOZlzyaZ4oi11
TokenSecret = AdvYIPoDY7HX1aiVgusJOZlzyaZ4oi11, Replace with your Key where TokenSecret is used below.



NODEJS WITH AUTHORIZATION HEADER CREDENTIALS

var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
'method': 'POST',
'hostname': 'input.digitalstakeout.com',
'path': '/insert',
'headers': {
'Authorization': 'Bearer TokenSecret',
'Content-Type': 'application/json'
},
'maxRedirects': 20
};

var req = https.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {
chunks.push(chunk);
});

res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});

res.on("error", function (error) {
console.error(error);
});
});

var postData = JSON.stringify({
"eventAppSource": "digitalstakeout",
"eventAction": "insert",
"eventSrcScreenName": "dso",
"eventSrcAuthor": "DigitalStakeout",
"eventSrcDomain": "digitalstakeout.com",
"eventSrcIP": "1.1.1.1",
"eventGenerator": "website",
"eventDefinedTag": "tag",
"eventPayload": "This is a test."
});

req.write(postData);

req.end();




JAVA WITH AUTHORIZATION HEADER CREDENTIALS

OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"eventAppSource\": \"digitalstakeout\",\n\t\"eventAction\": \"insert\",\n\t\"eventSrcUrl\": \"https://www.digitalstakeout.com/12345/\",\n\t\"eventSrcScreenName\": \"dso\",\n\t\"eventSrcAuthor\": \"DigitalStakeout\",\n\t\"eventSrcDomain\": \"digitalstakeout.com\",\n\t\"eventSrcIP\": \"1.1.1.1\",\n\t\"eventGenerator\": \"website\",\n\t\"eventDefinedTag\": \"tag\",\n\t\"eventPayload\": \"This is a test.\"\n}");
Request request = new Request.Builder()
.method("POST", body)
.addHeader("Authorization", "Bearer TokenSecret")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();



PYTHON AUTHORIZATION HEADER CREDENTIALS

import requests
import json


payload = json.dumps({
"eventAppSource": "digitalstakeout",
"eventAction": "insert",
"eventSrcScreenName": "dso",
"eventSrcAuthor": "DigitalStakeout",
"eventSrcDomain": "digitalstakeout.com",
"eventSrcIP": "1.1.1.1",
"eventGenerator": "website",
"eventDefinedTag": "tag",
"eventPayload": "This is a test 1."
})
headers = {
'Authorization': 'Bearer TokenSecret',
'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)





C# AUTHORIZATION HEADER CREDENTIALS

var client = new RestClient("https://input.digitalstakeout.com/insert"
);
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer TokenSecret");
request.AddHeader("Content-Type", "application/json");
var body = @"{" + "\n" +
@" ""eventAppSource"": ""digitalstakeout""," + "\n" +
@" ""eventAction"": ""insert""," + "\n" +
@" ""eventSrcUrl"": ""https://www.digitalstakeout.com/12345/"","
+ "\n" +
@" ""eventSrcScreenName"": ""dso""," + "\n" +
@" ""eventSrcAuthor"": ""DigitalStakeout""," + "\n" +
@" ""eventSrcDomain"": ""digitalstakeout.com""," + "\n" +
@" ""eventSrcIP"": ""1.1.1.1""," + "\n" +
@" ""eventGenerator"": ""website""," + "\n" +
@" ""eventDefinedTag"": ""tag""," + "\n" +
@" ""eventPayload"": ""This is a test.""" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);





PHP AUTHORIZATION HEADER CREDENTIALS

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"eventAppSource": "digitalstakeout",
"eventAction": "insert",
"eventSrcScreenName": "dso",
"eventSrcAuthor": "DigitalStakeout",
"eventSrcDomain": "digitalstakeout.com",
"eventSrcIP": "1.1.1.1",
"eventGenerator": "website",
"eventDefinedTag": "tag",
"eventPayload": "This is a test."
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer TokenSecret',
'Content-Type: application/json'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;






Validating Response:

{"response_code":200,"message":"Content Published"}

Your input is important to us.  If you have any questions or suggestions, please email support@digitalstakeout.com.



 





    Need help with this?

    The DigitalStakeout team is happy to help! To request assistance, open a ticket .





      • Related Articles

      • Create Page Collector

        The DigitalStakeout Page Collector provides the ability for you to pull Content from a URL on a recurring frequency supported in your plan. Navigate to the Setup Page, Select Data Aggregation Tab, Click Add Monitor. When the "Create Page Monitor" ...
      • Create Email Collector

        Create Email Collector The DigitalStakeout Email Collector provides the ability for you to send or forward emails to Scout for collection and analysis. You can use this monitor to collect important emails from your organization. Customers also use ...
      • Create an RSS Collector

        RSS (Really Simple Syndication) is a regularly updated XML file containing a list of newly published content from a selected website or websites that can be read by another program. The RSS Collector regularly monitors and centralizes all the feeds ...
      • Create/Edit Email Template

        Navigate to the alerts page by either selecting "create alert" from the home screen or hovering over "setup" and selecting "alerts." Just below the words "Workflow Rules" centered at the top of this screen, on the left side you will see "email ...
      • Create New User

        DigitalStakeout provides the ability to create new user accounts with varying permissions and access to the DigitalStakeout product. Note: The "Create New User" feature can only be created by users with Super User level of permissions.  The "My ...