Document toolboxDocument toolbox

HTTP endpoint

Tokens are employed to authorize the event sources that send data to Devo over HTTP. Generate a token for your HTTP endpoint in the Devo web application, then use that token to set up event sending from your HTTP endpoint.

Create the token needed to authorize the endpoint

The OAuth token is a 32-character alphanumeric string that authorizes a connection to Devo. When this token is used when making HTTP requests to Devo, it is recognized by the platform and the connection is authorized and the request carried out. To create the token:

Configure the HTTP endpoint

Once the token has been generated, you can configure the endpoint. The URL to send the HTTP request follows this format:

<endpoint>/<mode>/<domain>/token!<token>/<host>/<tag>?<message>

Where each element in the URL is described below:

  • <endpoint> - Use the endpoint that corresponds to the Devo Cloud region you use.

    • USA - http[s]://http-us.devo.io

    • Europe - http[s]://http-eu.devo.io

    • Asia-Pacific (APAC) -https://collector-ap.devo.io:8443

  • <mode> - This can be either event (for sending single events. GET, POST, and PUT accepted) or stream (for sending multiple events, POST and PUT accepted). Each mode accepts the HTTP methods as follows:

  • .<domain> - The Devo domain the events are being sent to.

  •  <token> - The token you generated in Devo to authorize your connection. 

  •  <host> - The hostname of the sending host. If unknown, enter "-".

  •  <tag> - The Devo tag to apply to the events.

  •  <message> - The message to be logged.

Here is an example of an endpoint URL:

http://http-us.devo.io/event/myDomain/token!a5370g9e8f7d7edf9d/local1/my.app.http.js?this%20is%20a%20example%20of%20log

Code samples

Here you can see a few examples of how token-based HTTP requests can be sent from an endpoint to a table (or tables) in a Devo domain. 

Python - Sending a single event

import requests from urllib.parse import quote devo_endpoint="http://devoEndpoint" domain="demoDomain" token="example_token_1234abcd" hostname="my_src_hostname" devo_table="my.app.demo.send" message = quote("test event") url = f'{devo_endpoint}/event/{domain}/token!{token}/{hostname}/{devo_table}?{message}' payload={} headers = {} requests.request("GET", url, headers=headers, data=payload)

Python - Sending a file with events

Java

Java (POST example)

HTML - jQuery

HTML - JavaScript

cURL - Sending a single event

cURL - Sending a file with events

.

Related articles