Templates

Remember instance an object of FouryouseeAPI, according to the basic set up

Getting the templates

fouryousee.FouryouseeAPI.get_templates(self, **kwargs)

Get the templates of the 4YouSee account.

Parameters

id (int, optional) – Id of the template.

Returns

List of dicts, where every dict, depicts a template.

Return type

list

Usage

Once “my” object has been created. You can execute the next:

Getting all templates. It will return all the templates of your account. It will be a list of dicts. If there is no template will return a empty list.

>>> my.get_templates()
[
   {
      "id":35,
      "name":"Barra Logo Horizontal HTML5",
      "width":402,
      "height":100,
      "type":"zip"
   },
   {
      "id":39,
      "name":"Facebook v1 - Área Principal",
      "width":1280,
      "height":720,
      "type":"zip"
   },
   {
      "id":41,
      "name":"Instagram - Área Principal",
      "width":1280,
      "height":720,
      "type":"zip"
   },
   {
      "id":48,
      "name":"Finance: Bovespa-Nasdaq-Nikkei Horizontal HTML5",
      "width":1280,
      "height":720,
      "type":"zip"
   },
   {
      "id":54,
      "name":"CNN - Área Principal",
      "width":1280,
      "height":720,
      "type":"zip"
   },
   {
      "id":55,
      "name":"Yahoo Weather - Área Principal",
      "width":1280,
      "height":720,
      "type":"zip"
   }
]

If you know the template id

>>> my.get_templates(id=39)
[
   {
      "id":39,
      "name":"Facebook v1 - Área Principal",
      "width":1280,
      "height":720,
      "type":"zip"
   }
]

If the id doesn’t exists.

>>> my.get_templates(id=123_456)
[]