Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
maxLevel2
typeflat

...

Element

Description

<endpoint>

  • USA: https://http-us.devo.io:443

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

  • Canada: https://http-ca.devo.io:443/

  • Asia-Pacific (APAC): https://collector-ap.devo.io:8443 (The endpoint will be different depending on the ingestion source. Currently we have collector-ap for Singapore and collector-ap2 for Sydney)

Use the endpoint that corresponds to the Devo Cloud region you use.

<mode>

This can be one of the following:

  • event - Use this mode to send single events. GET and POST methods are accepted.

  • stream - Use this mode to send multiple events. Only POST is accepted. Use the header Content-Encoding: gzip to send multiple compressed events in your request body. Check an example in the section below.

<domain>

The name of the Devo domain where the events are being sent to.

<token>

The token you generated in Devo to authorize your connection. 

<tag>

The Devo tag to be applied to the events. Learn more about tags in About Devo tags.

<message>

The log to be sent. Note that this is only valid if you’re using the event mode, that is to say, you're sending a single event to Devo. In this case, the event is added to the query string.

In case of a POST request in stream mode, events should be added to the request body. See some examples of this in the section below.

Here is an example of an endpoint URL:

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

Response codes

Note that this API returns a 2xx status code upon receiving a request, and this does not mean the request is completed yet. You will immediately receive a 204 No Content code if you're using the /event mode, and a 200 OK code if you are using the /stream mode.

In order to check if the request has been finished and the events are properly stored, you must query them and verify that they are available.

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. 

Table of Contents
maxLevel3
minLevel3

Python - Sending a single event

...

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. 

Table of Contents
maxLevel3
minLevel3

Python - Sending a single event

Code Block
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)

...

Code Block
curl -v --request POST --url '<DEVO_ENDPOINT>/stream/<DOMAIN>/token!<TOKEN>/<HOSTNAME>/<TAG>' --header 'Content-Encoding: gzip' --data-binary @<FILE_PATH>

Response codes

Take into consideration the following points related to the response codes returned by the HTTP API:

  • The HTTP API is designed as an asynchronous API that immediately returns a 2XX status code upon receiving a request.

  • The 2XX status code of the response only indicates that the request has been received but not completed yet.

  • The response is sent prior to any further processing, including token validation (authentication and authorization), or any other checks that may result in an invalid event submission.

  • The specific 2xx status code depends on the mode of the request. The /event mode returns a 204 No Content status code while the /stream mode returns a 200 OK

  • The only way to verify that an event is properly stored is by querying it.

  • This HTTP API operates similarly to job submissions commonly used in batch-processing scenarios.