Saving a Time Frame – synthetic API


The PUT method of the API creates or updates a Time Frame.

Before you begin

You must obtain an authToken by using the login API. The token authenticates the user performing the operation. For details, see  TSWS authentication .

Synthetic configuration APIs

Notes:

  • If you have upgraded to version 11.3.02, you can access the Synthetic Blackout and Synthetic Time Frames APIs listed in this table.
  • If you are using version 11.3.01 or earlier, you can continue to use the Execution Plan APIs to access the Blackouts.
APIMethodDescription
Applications

GETRetrieve the details of applications
PUT

Update an existing application

POSTCreate a new application
DELETEDelete an application

Execution Plans



GETRetrieve the details of Execution Plans
PUT
DELETEDelete an Execution Plan
ScriptsGETRetrieve the details of scripts
LocationsGETRetrieve the details of all locations

Blackouts

POSTRetrieve the details of Blackouts
PUT
POSTActivate the Blackout
POSTDeactivate the Blackout
POSTDelete a Blackout

Time Frames

POSTRetrieve the details of Time Frames
PUT
POSTDelete Time Frames
 

To save a Time Frame

  • The  API uses the PUT method with a blank ID value to create a Time Frame.
  • The  API uses the PUT method with a valid Time Frame ID to update the Time Frame.


Request syntax

https://<PresentationServerHostName>/tsws/10.0/api/appvis/synthetic/api/timeframes/save

Request with REST client

After accessing the REST client, perform the following steps:

  1. Enter the URL for the API.
    An example of a request to create a Time Frame is:
    https://localhost/tsws/10.0/api/appvis/synthetic/api/timeframes/save
  2. Add a new header row and select Authorization as the header type.

  3. Enter the text authToken followed by the authToken  generated through the login API. 
  4. Enter the json code in the request body
  5. Click Send.

Request parameters

ElementDescription
authToken

Value of authToken

Request body

The following code is an example of the JSON code to send with the request. The code returns the ID of the Time Frame being saved or an error message.

  • If the "id" field is blank or contains no value, a new Time Frame configuration is saved.
  • If the "id" field contains a valid Time Frame ID, the existing Time Frame configuration is updated.


Sample request to create a Time Frame

Sample request to update a Time Frame

Request body parameters

ParameterDescriptionValue
Id
Time Frame ID

For creating a Time Frame, do not set any value. id=" "

For updating a Time Frame, set the Time Frame ID. id = <Time Frame ID>

name
Name of the Time FrameString. It must be between 1 - 255 characters.
description
Description of the Time Frame

String.

(Optional) It can be blank. If you specify, it must be less than or equal to 255 characters.

associatedObjects
Associated Blackout IDs that use the Time Frame

Do not set any value when you create or update it.

recurrenceFrequency


     recurrenceFrequencyDetails

Recurrence Frequency details

ALWAYS

  • start immediately – ‘0’
  • Start from – date format  dd-mm-yyyy

ONCE

  • Date format : dd-mm-yyyy

WEEKLY

  • Days of the week when the blackout period is in effect.

Comma-separated numeric values:

 1,2,3,4,5,6,7 (Where 1 is Monday and 7 is Sunday.)

MONTHLY

  • Days of the month when the blackout period is in effect:

Numeric value or range , for example

2 or 2,3,5 or 2-6

     recurrenceFrequencyType

Recurrence Frequency options

  • ALWAYS
  • ONCE
  • WEEKLY
  • MONTHLY
timeSpan


     startTime
Time  from when the blackout period is in use

HH:MM

Note: Do not set any value for the combination ALWAYS ACTIVE and Start Immediately options.

     endTime
Time from when the blackout period is no longer used

TIME:

  • HH:MM For example,  21:00

DURATION:

  • Hours:Minutes For example, 03:30
    Notes: Maximum Duration for Once is 999 Hours. Maximum Duration for Weekly and Monthly is 24 Hours.

End Of Day – 00:00

Note: No value is required for the ALWAYS option.

     endTimeType
End Time options
  • TIME
  • DURATION
  • NA - This is relevant only when you are using the ALWAYS option.

Note: For End Of Day, set the endTimeType value as TIME and endTime value as 00:00.

Response

The response returns the Time Frame ID.

Related topics

Developing

Was this page helpful? Yes No Submitting... Thank you

Comments