Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel

...

3

...

outline

...

true

...

exclude.*.[1]

Bash

Necessary (++) and useful (+) programs

Basic Login

Using commandline requires curl to submit http requests to the API.

...

and can be removed after successful operation by

rm -v cfile

HTTP requests

GET

This gets basic information about an item.

...

Basically a POST was already done by token creation. For most purposes POST appears to be of minor importance.

Python

Necessary (++) and useful (+) packages

...

json, re, itertools, and datetime are built-in moduls and do not need to be installed separately.

Basic Login

The carried body contains the authentification credentials as a dict element. The auth cookie is then extracted (theToken) from the response of the POST request (see http requests).

import requests
import json

auth = requests.post('https://sandbox.sensor.awi.de/rest/sensors/contacts/login'
	                 , data = {'username': <yourUserName>, 'authPassword': <yourSecretPassword>}
)
theToken = auth.cookies['x-auth-token']

HTTP requests

GET

This gets basic information about an item. The result is a dictionary object.

...

Basically a POST was already done by token creation. For most purposes POST appears to be of minor importance.

R

Necessary (++) and useful (+) packages

install.packages(c('httr', 'lubridate', 'jsonlite', 'stringr'), dep = TRUE)

Basic Login

The carried body contains the authentification credentials as a list element. The auth cookie is then extracted (theToken) from the response of the POST request (see http requests).

library('httr')

x <- POST(url = 'https://sandbox.sensor.awi.de/rest/sensors/contacts/login'
        , body = list("username" = '<yourUserName>', "authPassword" = 'yourSecretPassword')
        , encode = "form"
          )
theToken <- x$cookies$value[2]

HTTP requests

GET

This gets basic information about an item. The result is a list object.

...