Versions Compared

Key

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

Web Services para Administrar Encuestas a realizar a los Clientes

Swagger open api macroswagger: '2.0' info: title: "SIFCO_REST_API" version: "1.0" description: "La presente documentación busca detallar los métodos que permite ejecutar este **Web Services**, como es Registrar o Modificar una Encuesta a ser Realizada a un cliente en la **Aplicación SIFCO WEB** ." termsOfService: "https://sifco.org/sobre-nosotros/" contact: email: "soporte@sifco.org" license: name: "Apache 2.0" url: "http://www.apache.org/licenses/LICENSE-2.0.html" host: "<SERVER>" schemes: - https - http basePath: /<APPDIR>/rest tags: - name: "PPI_Encuesta" externalDocs: description: "Manual SIFCO" url: "https://sifco.atlassian.net/wiki/x/HoDb" produces: - application/json paths: /PPI_Encuesta/{PPI_EncuestaID}: get: tags: - PPI_Encuesta operationId: "GetPPI_Encuesta" summary: "Consultar la Encuesta a Realizar a un Cliente en el Sistema" parameters: - in: header name: Content-Type type: "string" required: true default: application/json - in: header name: Authorization type: "string" required: true default: OAuth <Access Token> - in: header name: GENEXUS-AGENT type: "string" required: true default: SmartDevice Application - name: "PPI_EncuestaID" in: "path" description: "Encuesta Realizada" required: true type: "integer" format: "int32" responses: 200: description: "Successful operation" schema: $ref: "#/definitions/PPI_Encuesta" 400: description: "Bad request" schema: $ref: "#/definitions/GxJsonError" 401: description: "Not Authenticated" schema: $ref: "#/definitions/GxJsonError" 404: description: "Data with the specified key could not be found" schema: $ref: "#/definitions/GxJsonError" 500: description: "Internal server error" schema: $ref: "#/definitions/GxJsonError" post: tags: - PPI_Encuesta operationId: "InsertPPI_Encuesta" summary: "Insertar la Encuesta a Realizar a un Cliente en el Sistema" parameters: - in: header name: Content-Type type: "string" required: true default: application/json - in: header name: Authorization type: "string" required: true default: OAuth <Access Token> - in: header name: GENEXUS-AGENT type: "string" required: true default: SmartDevice Application - name: "PPI_EncuestaID" in: "path" description: "Encuesta Realizada" required: true type: "integer" format: "int32" - name: "PPI_Encuesta" in: "body" description: "SDT of PPI_Encuesta" required: false schema: $ref: "#/definitions/PPI_Encuesta" responses: 200: description: "Successful operation" schema: $ref: "#/definitions/PPI_Encuesta" 201: description: "Created" schema: $ref: "#/definitions/PPI_Encuesta" 400: description: "Bad request" schema: $ref: "#/definitions/GxJsonError" 401: description: "Not Authenticated" schema: $ref: "#/definitions/GxJsonError" 404: description: "Data with the specified key could not be found" schema: $ref: "#/definitions/GxJsonError" 500: description: "Internal server error" schema: $ref: "#/definitions/GxJsonError" put: tags: - PPI_Encuesta operationId: "UpdatePPI_Encuesta" summary: "Actualizar la Encuesta a Realizar a un Cliente en el Sistema" parameters: - in: header name: Content-Type type: "string" required: true default: application/json - in: header name: Authorization type: "string" required: true default: OAuth <Access Token> - in: header name: GENEXUS-AGENT type: "string" required: true default: SmartDevice Application - name: "PPI_EncuestaID" in: "path" description: "Encuesta Realizada" required: true type: "integer" format: "int32"

DESCRIPCIÓN.

Este Web Service, permite consultar las Encuestas a ser Realizadas a los Clientes registrados en la Aplicación SIFCO WEB, obteniendo una descripción detallada de la misma tanto a nivel de preguntas, como de respuestas esperadas de los clientes.

Swagger open api macro
swagger: '2.0'
info:
  title: "SIFCO_REST_API"
  version: "1.0"
  termsOfService: "https://sifco.org/sobre-nosotros/"
  contact:
    email: "soporte@sifco.org"
  license:
    name: "Apache 2.0"  
    url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "<SERVER>"
schemes:
  - https
  - http
basePath: /<APPDIR>/rest
tags:
- name: "PPI_Encuesta"
  externalDocs:
    description: "Manual SIFCO"
    url:  in: "body"
          description: "SDT of PPI_Encuesta""https://sifco.atlassian.net/wiki/x/HoDb"
produces:
  - application/json
paths:
  /PPI_Encuesta/{PPI_EncuestaID}:
          requiredget:
true      tags:
    schema:    - PPI_Encuesta
       $refoperationId: "#/definitions/PPIGetPPI_Encuesta"
      summary: "Consultar la Encuesta a Realizar a un Cliente responses:en el Sistema"
      200parameters:
        -  descriptionin: "Successfulheader
operation"           schemaname: Content-Type
           $reftype: "#/definitions/PPI_Encuestastring"
        400:           descriptionrequired: "Badtrue
request"           schema:default: application/json
        - in: header
 $ref: "#/definitions/GxJsonError"        name: 401:Authorization
          descriptiontype: "Not Authenticatedstring"
          schemarequired: true
           $ref: "#/definitions/GxJsonError"default: OAuth <Access Token>
        - 404in: header
          descriptionname: "Not found"GENEXUS-AGENT
           schematype: "string"
           $refrequired: "#/definitions/GxJsonError"true
          409default: SmartDevice Application
        description- name: "PPI_EncuestaEncuestaID"
was changed"         500in: "path"
          description: "InternalEncuesta server errorRealizada"
          schemarequired: true
          type:  $ref"integer"
          format: "#/definitions/GxJsonErrorint32"
      delete:
      tagsresponses:
        200:
  - PPI_Encuesta       operationIddescription: "DeletePPI_Encuesta"
Successful operation"
     summary: "Eliminar la Encuesta a Realizarschema:
a un Cliente en el Sistema"       parameters$ref: "#/definitions/PPI_Encuesta"
       - in400:
header          description: name: Content-Type"Bad request"
          typeschema:
 "string"           required$ref: true"#/definitions/GxJsonError"
          default401:
application/json         - indescription: "Not headerAuthenticated"
          nameschema:
Authorization            type$ref: "string#/definitions/GxJsonError"
          required404:
true           defaultdescription: OAuth"Data <Accesswith Token>the specified key could not be found"
  - in: header      schema:
    name: GENEXUS-AGENT           type$ref: "string#/definitions/GxJsonError"
        500:
 required: true        description: "Internal server default:error"
SmartDevice Application         -schema:
name: "PPI_EncuestaID"           in$ref: "path#/definitions/GxJsonError"

security:
  - OAuth2: []
    descriptionApiKeyAuth1: "Encuesta Realizada"[]
securityDefinitions:
  OAuth2:
       requiredtype: trueoauth2
    flow: password
    type: "integer"tokenUrl: https://test.sifco.org/DemoCoopGT/oauth/access_token
    scopes:
      formatExecute: "int32"Permite el método tipo GET
   responses:   Insert: Permite el método tipo POST
200:      Update: Permite el método tipo description:PUT
"Successful operation"     Delete: Permite el método tipo DELETE
schema:      FullControl: Permite el manejo de los Cuatro $ref: "#/definitions/PPI_Encuesta"
        204Métodos GET, POST, PUT,DELETE, sobre el Web Service
  ApiKeyAuth1:
    type: apiKey
    descriptionin: "Successfulheader
operation"    name: granttype

definitions:

  schemaPPI_Encuesta:
    properties:
       $ref: "#/definitions/PPI_Encuesta"EncuestaID:
        400description: Encuesta Realizada
        descriptiontype: "Bad requestinteger"
        format: "int32"
schema:
      PPI_EncuestaDescripcion:
     $ref: "#/definitions/GxJsonError"  description: Nombre de la Encuesta
  401:      type: "string"

  description: "Not Authenticated"  PPI_EncuestaExplicacion:
        schemadescription: Descripción Técnica de la Encuesta
        $reftype: "#/definitions/GxJsonErrorstring"

       404:
 PPI_EncuestaUsuario:
        description: Usuario "Notque found"Modifica la Encuesta
        schematype: "string"

        PPI_EncuestaFechaUltimoCambio:
 $ref: "#/definitions/GxJsonError"      description: Fecha del 500:Ultimo Cambio
         descriptiontype: "Internalstring"
 server error"      format: "date-time"

  schema:    PPI_EncuestaEstado:
        $refdescription: "#/definitions/GxJsonError"Estado
  security:   - OAuth2: [] type: "boolean"

 ApiKeyAuth1: [] securityDefinitions:   OAuth2PPI_EncuestaScoreMax:
    type: oauth2     flowdescription: passwordTotal del   Score
tokenUrl: https://test.sifco.org/DemoCoopGT/oauth/access_token        scopestype: "integer"
     Execute: Permite el metodo tipo GET   format: "int32"

      gx_md5_hash:
        Insertdescription: Permite el metodo tipo POST
      Update: Permite el metodo tipo PUT
      Delete: Permite el metodo tipo DELETE
 gx_md5_hash is an identifier for a specific version of a resource, it is used for optimistic concurrency check. It is required for update and delete operations and  ignored on insert.
    FullControl: Permite el manejo de los Cuatro Metodos GET, POST, PUT,DELETE, sobre el Web Service
  ApiKeyAuth1:type: "string"

      Preguntas:
        type: apiKey$ref: "#/definitions/PPI_Encuesta.PreguntasEncuesta"

    inrequired:
header     name: granttype

definitions:- PPI_EncuestaID

  PPI_Encuesta.PreguntasEncuesta:
    properties:
      PPI_EncuestaIDEncuestaPreguntaID:
        description: EncuestaPregunta
Realizada         type: "integer"
        format: "int32"

      PPI_EncuestaDescripcionEncuestaPreguntaTexto:
        description: NombreTexto de la EncuestaPregunta
        type: "string"

      PPI_EncuestaExplicacionEncuestaPreguntaTipo:
        description: Descripción Técnica de la Encuesta
        type: "string"

      PPI_EncuestaUsuario:
    Tipo de Pregunta
    description: Usuario que Modifica la Encuestatype: "integer"
        typeformat: "stringint32"

      PPI_EncuestaFechaUltimoCambioEncuestaPreguntasScore:
        description: FechaScore Máximo delde Ultimola CambioPregunta
        type: "stringinteger"
        format: "date-timeint32"

      PPI_EncuestaEstadoEncuestaPreguntaObligatoria:
        description: EstadoEs una pregunta obligatoria
        type: "boolean"

      PPI_EncuestaScoreMaxRespuestas:
        description$ref: Total del Score"#/definitions/PPI_Encuesta.PreguntasEncuesta.Respuestas"

    required:
   type: "integer"  - PPI_EncuestaPreguntaID
     formatx-gx-level: "int32PPI_Encuesta"

  PPI_Encuesta.PreguntasEncuesta.Respuestas:
    gx_md5_hashproperties:
      PPI_EncuestaRespuesta:
 description: gx_md5_hash is an identifier for a specific versiondescription: ofRespuesta
a resource, it is used for optimistic concurrency check. It is required for update and delete operations and  ignored on insert.type: "string"

      PPI_EncuestaRespuestaScore:
        description: Valor de la type:Respuesta
"string"        Preguntastype: "integer"
       $ref format: "#/definitions/PPI_Encuesta.PreguntasEncuestaint32"


    required:
      - PPI_EncuestaID

  PPI_Encuesta.PreguntasEncuesta:EncuestaRespuesta
    propertiesx-gx-level: "Preguntas"

  GxJsonError:
  PPI_EncuestaPreguntaID:  properties:
      descriptionerror:
Pregunta         type$ref: "integer#/definitions/GxJsonError.error"

  GxJsonError.error:
    formatproperties:
"int32"        PPI_EncuestaPreguntaTextocode:
        description: TextoCódigo de laError
Pregunta         type: "string"

      PPI_EncuestaPreguntaTipomessage:
        description: TipoMensaje de PreguntaError
        type: "integerstring"


      format: "int32"

      PPI_EncuestaPreguntasScore:
        description: Score Máximo de la Pregunta
        type: "integer"
        format: "int32"

      PPI_EncuestaPreguntaObligatoria:
        description: Es una pregunta obligatoria
        type: "boolean"

      Respuestas:
        $ref: "#/definitions/PPI_Encuesta.PreguntasEncuesta.Respuestas"

    required:
      - PPI_EncuestaPreguntaID
    x-gx-level: "PPI_Encuesta"

  PPI_Encuesta.PreguntasEncuesta.Respuestas:
    properties:
      PPI_EncuestaRespuesta:
        description: Respuesta
        type: "string"

      PPI_EncuestaRespuestaScore:
        description: Valor de la Respuesta
        type: "integer"
        format: "int32"


    required:
      - PPI_EncuestaRespuesta
    x-gx-level: "Preguntas"

  GxJsonError:
    properties:
      error:
        $ref: "#/definitions/GxJsonError.error"

  GxJsonError.error:
    properties:
      code:
        description: Codigo de Error
        type: "string"

      message:
        description: Mensaje de Error
        typex-gx-level: "GxJsonError"

EJEMPLOS DE REQUEST Y RESPONSE, PARA LOS SERVICIOS RESTful BAJO PROTOCOLO HTTP.

A continuación se muestra una tabla con un ejemplo de una Solicitud y un Respuesta para este Web Service.

METODO GET

Este método para este Web Service en especifico permite consultar las encuestas a ser realizadas a los Clientes registrados en la Aplicación SIFCO WEB.

El siguiente ejemplo permite consultar una encuesta a ser realizada a un Cliente registrado en la en la Aplicación SIFCO WEB.

Tipo de Mensaje HTTP

Ejemplo

REQUEST

URL:

Code Block
languagehtml
https://test.sifco.org/democoopgt/rest/ppi_encuesta/3

HEADERS

Code Block
languagejson
content-type: application/json
authorization: OAuth f2a9ec34-cf83-46f5-8862-f78........
genexus-agent: SmartDevice Application

200 (Successful operation)

Operación Exitosa

Code Block
languagejson
{
  "PPI_EncuestaID": 3,
  "PPI_EncuestaDescripcion": "string",
  "PPI_EncuestaExplicacion": "string",
  "PPI_EncuestaUsuario": "string",
  "PPI_EncuestaFechaUltimoCambio": "2019-09-30T00:31:43.184Z",
  "PPI_EncuestaEstado": true,
  "PPI_EncuestaScoreMax": 0,
  "gx_md5_hash": "string",
  "Preguntas": {
    "PPI_EncuestaPreguntaID": 0,
    "PPI_EncuestaPreguntaTexto": "string",
    "PPI_EncuestaPreguntaTipo": 0,
    "PPI_EncuestaPreguntasScore": 0,
    "PPI_EncuestaPreguntaObligatoria": true,
    "Respuestas": {
      "PPI_EncuestaRespuesta": "string",
      "PPI_EncuestaRespuestaScore": 0
    }
  }
}

400 (Bad Request).

Solicitud Errada

Code Block
languagejson
{
  "error": {
    "code": "string",
    "message": "string"
  }
}

401 (This service needs an Authorization Header)

(No Autenticado, asociado normalmente a que no se respetaron las cabeceras obligatorias para el consumo de este Web Service, para mayores detalles consultar (Configuración de Seguridad para Obtener Token de Acceso y Consumir de los Web Services) ).

Code Block
languagejson
{
  "error": {
    "code":"0",
    "message":"This service needs an Authorization Header"
  }
}

404 (Not Found).

Respuesta Vacía (Web Service, no encontrado)

500 (Internal Server Error)

(Error Interno del Servidor de las API’s REST).

Code Block
languagejson
{
  "error": {
    "code": "string",
    "message": "string"
  
x-gx-level: "GxJsonError"
}
}

Info

INFORMACIÓN

Para identificar el MENSAJE DE ERROR remitirse a la pagina de (Listado de Mensajes), donde se describe el listado de mensajes que arroja las API’s REST de la Aplicación SIFCO WEB, con su respectiva Descripción.

Note

NO DEBE OLVIDAR

NO olvide tomar en cuenta para el uso de este Web Service, el Flujo de Trabajo descrito en Web Services de Clientes, dado a que en caso de no seguirlo al pie de la letra puede generar errores inesperados en la ejecución.

Note

RESPETE LOS ENCABEZADOS OBLIGATORIOS para que pueda consumir el WEB SERVICE respectivo.

Code Block
languagejson
Content-Type: application/json
Authorization: OAuth f2a9ec34-cf83-46f5-8862-f78ac03670d1!171380a787a9152688ab61a94d66e0eb77...
GENEXUS-AGENT: SmartDevice Application
Warning

EN CASO DE ERROR HTTP 401 (Not Authenticated)

Por favor validar que esta colocando los Encabezados Adecuadamente, y de persistir el problema dirigirse a la Pagina (Configuración de Seguridad para Obtener Token de Acceso y Consumir de los Web Services), para generar nuevamente su Token de Acceso, y/o verificar problemas con su acceso al API REST.

Live Search
spaceKeyDOC
placeholderBúsqueda en esta Pagina
typepage

Artículos Relacionados

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel in ( "informacion" , "tecnica" , "api" , "rest" , "web" , "services" , "clientes" , "encuestas" ) and type = "page" and space = "DOC"

Artículos Actualizados Recientemente

Recent updates
typespage
max5
spacesDOC
themeconcise
hideHeadingtrue
Change History