---
# System prepended metadata

title: Untitled

---

Api Comix

Ejemplo de json que retorna el api
```
"questions": {
 "id": 23,
 "type": "type",
 "question": "Pregunta",
 "sub_section_a": "opcion 1",
 "sub_section_b": "opcion 2",
 "sub_section_c": "opcion 3",
 "sub_section_d": "opcion 4",
 "sub_section_e": "opcion 5",
 "sub_section_f": "opcion 6"
}

```
Ejemplo de respuesta

POST /questions/{question-id}
type: simple
Las pregunas simples son para q el usuario escriba
```
{
    "type": "simple",
    "answer": "Respuesta usuario"
    "sub_section_a": false,
    "sub_section_b": false,
    "sub_section_c": false,
    "sub_section_d": false,
    "sub_section_e": false,
    "identifier": "xxxx-xxx",
    "timestamp": "",
    "latitude": "41.836899",
    "longitude": "-87.6847"
}
```

POST /questions/{question-id}
type: multiple_one
El usuario selecciona solo una opcion,
para el ejemplo el usuario selecciona la respuesta b
```
{
    "type": "multiple_one",
    "answer": ""
    "sub_section_a": false,
    "sub_section_b": true,
    "sub_section_c": false,
    "sub_section_d": false,
    "sub_section_e": false,
    "identifier": "xxxx-xxx",
    "timestamp": "",
    "latitude": "41.836899",
    "longitude": "-87.6847"
}
```

POST /questions/{question-id}
type: multiple_choises
El usuario selecciona una o mas opciones,
para el ejemplo el usuario selecciona la respuesta a,b y c
```
{
    "type": "multiple_choises",
    "answer": ""
    "sub_section_a": true,
    "sub_section_b": true,
    "sub_section_c": true,
    "sub_section_d": false,
    "sub_section_e": false,
    "identifier": "xxxx-xxx",
    "timestamp": "",
    "latitude": "41.836899",
    "longitude": "-87.6847"
}
```


POST /questions/{question-id}
type: yesNo
Falso o verdadero, en este caso sub_section_a es verdadero y sub_section_b es falso
```
{
    "type": "yesNo",
    "answer": ""
    "sub_section_a": true,
    "sub_section_b": false,
    "sub_section_c": false,
    "sub_section_d": false,
    "sub_section_e": false,
    "identifier": "xxxx-xxx",
    "timestamp": "",
    "latitude": "41.836899",
    "longitude": "-87.6847"
}
```


















---


Las respuesta del api de comix estan dentro del archivo json, este archivo json se abre con insomnia


1. Cambiar localhost:8080 por http://18.222.137.55:9090/

**Endpoinst necesarios**

1.- Listado de historias

![](https://i.imgur.com/bWMtW2b.png)

Listado de historias hace uso del siguiente end point 
http://18.222.137.55:9090/api/v1/projects/1/stages
Ejemplo
```
{
  "id": 1,
  "name": "Proyecto 1",
  "description": "Proyecto 1",
  "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/project_1.png",
  "position": 1,
  "stages": [
    {
      "id": 1,
      "name": "Historia 1",
      "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/stage_1.png",
      "position": 1
    }
  ]
}
```
2.- Listado de las subHistoria dentro de la historia
http://18.222.137.55:9090/api/v1/projects/1/stages/1/sessions

Donde:
http://18.222.137.55:9090/api/v1/projects/1/stages/{stage_id}/sessions
stage_id = es el id del stage

Ejemplo de salida
```
{
  "id": 1,
  "name": "Proyecto 1",
  "description": "Proyecto 1",
  "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/project_1.png",
  "position": 0,
  "stages": {
    "id": 1,
    "name": "Un nuevo inicio",
    "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/stage_1.png",
    "position": 0,
    "sessions": [
      {
        "id": 1,
        "name": "Historia Niño",
        "Watch": 0,
        "finished": 0,
        "author": "",
        "description": "session1",
        "position": 0,
        "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/session_1.png",
        "labyrinthine": 0
      },
      {
        "id": 2,
        "name": "Continuacion Historia Niño",
        "Watch": 0,
        "finished": 0,
        "author": "",
        "description": "session2",
        "position": 0,
        "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/session_1.png",
        "labyrinthine": 1
      },
      {
        "id": 3,
        "name": "Historia Mujer ",
        "Watch": 0,
        "finished": 0,
        "author": "",
        "description": "session3",
        "position": 0,
        "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/session_1.png",
        "labyrinthine": 0
      },
      {
        "id": 4,
        "name": "Historia Hombre",
        "Watch": 0,
        "finished": 0,
        "author": "",
        "description": "session4",
        "position": 0,
        "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/session_1.png",
        "labyrinthine": 0
      },
      {
        "id": 5,
        "name": "Continuacion Historia Hombre",
        "Watch": 0,
        "finished": 0,
        "author": "",
        "description": "session5",
        "position": 0,
        "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/session_1.png",
        "labyrinthine": 1
      }
    ]
  }
}
```
Solo se visualizan las session que tengan el campo labyrinthine = 0

Ejemplo visualizacion
![](https://i.imgur.com/OONXcjC.png)

3.- LIstado de la viñetas
http://18.222.137.55:9090/api/v1/projects/1/stages/1/sessions/3/items
Donde
http://18.222.137.55:9090/api/v1/projects/1/stages/{stage_id}/sessions/{session_id}/items
stage_id = es el id del stage
session_id = es el id de la sesion 


Ejemplo Json
```
{
  "id": 1,
  "name": "Proyecto 1",
  "description": "Proyecto 1",
  "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/project_1.png",
  "position": 1,
  "stages": {
    "id": 1,
    "name": "Un nuevo inicio",
    "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/stage_1.png",
    "position": 1,
    "sessions": {
      "id": 3,
      "name": "Historia Mujer ",
      "Watch": 0,
      "finished": 0,
      "author": "",
      "description": "session3",
      "position": 3,
      "icon": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia//icons/session_1.png",
      "items": [
        {
          "type": "vignette",
          "vignetes": {
            "id": 9,
            "files": {
              "id": 9,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-1.png"
            }
          },
          "questions": {}
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 10,
            "files": {
              "id": 10,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-2.png"
            }
          },
          "questions": {}
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 11,
            "files": {
              "id": 11,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-3.png"
            }
          },
          "questions": {}
        },
        {
          "type": "question",
          "vignetes": {
            "files": {}
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 12,
            "files": {
              "id": 12,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-4.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 13,
            "files": {
              "id": 13,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-5.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 14,
            "files": {
              "id": 14,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-6.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 15,
            "files": {
              "id": 15,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-7.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 16,
            "files": {
              "id": 16,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-8.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 17,
            "files": {
              "id": 17,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-9.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 18,
            "files": {
              "id": 18,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-10.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 19,
            "files": {
              "id": 19,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-11.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 20,
            "files": {
              "id": 20,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-12.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        },
        {
          "type": "vignette",
          "vignetes": {
            "id": 21,
            "files": {
              "id": 21,
              "file_image": "https://comixstorage.s3.us-east-2.amazonaws.com/diaconia/H3/H3-13.png"
            }
          },
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
        }
      ]
    }
  }
}
```
En algunos questions de tupo labyrinthine, tiene el siguiente formato
```
          "questions": {
            "id": 23,
            "type": "labyrinthine",
            "question": "Que quieres hacer? ",
            "sub_section_a": "Continuar con el niño? |2|1",
            "sub_section_b": "Continuar aqui? |3|5"
          }
```
El elemento sub_section_a tiene el siguiente formato |2|1,
este formato es una redireccion a: http://18.222.137.55:9292/view.html?project=1&stage=1&session=2&page=1
En otroa palabras |2|1

2 es la session 
1 es la pagina que se debe visualizar


Ejemplo visualizacion
![](https://i.imgur.com/cx4EBK8.png)


