Seitenhierarchie
Zum Ende der Metadaten springen
Zum Anfang der Metadaten

URL: https://123.123.123.123/timeperiods/add.json

Methode: POST

Response: JSON



VALUERequired for addingDescriptionTypeExample

$CONTAINER_ID
(Warnung)The container ID, 1 for default root containerinteger1

$NAME(Warnung)The name of the time periodstring"my period 1"

$DESCRIPTION

The description of the time periodstring"my description"

$DAY(Warnung)

Day of the time range:

Monday => 1,

Tuesday => 2,

Wednesday => 3,

Thursday => 4,

Friday => 5,

Saturday => 6,

Sunday => 7

integer1

$START_TIME(Warnung)Start time of the time rangestring08:45

$END_TIME(Warnung)End time of the time rangestring10:50




JSON to create a time period via REST API
{
	"Timeperiod": {
   		"container_id": $CONTAINER_ID,
    	"name": "$NAME",
    	"description": "$DESCRIPTION",
},
	"Timerange": {
    	0: {
        	"day": $DAY,
        	"start": $START_TIME,
        	"end": $END_TIME
    	},
	}
}
Response on successful API call
{
	"id": "123"
}
Example error code for an already taken name
{
  "error": {
    "name": [
      "$NAME"
    ]
  }
}
  • Keine Stichwörter