Web Services para Administrar Encuestas a realizar a los Clientes
Swagger open api macro
swagger: '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: "ManualSIFCO"url: in: "body"
description: "SDT of PPI_Encuesta""https://sifco.atlassian.net/wiki/x/HoDb"
produces:
- application/json
paths:
/PPI_Encuesta/{PPI_EncuestaID}: requiredget:
truetags:schema:-PPI_Encuesta $refoperationId: "#/definitions/PPIGetPPI_Encuesta"summary:"ConsultarlaEncuestaaRealizaraunClienteresponses:enelSistema"200parameters:
- descriptionin: "Successfulheaderoperation" schemaname: Content-Type $reftype: "#/definitions/PPI_Encuestastring"
400: descriptionrequired: "Badtruerequest" schema:default: application/json-in:header$ref:"#/definitions/GxJsonError"name:401:Authorizationdescriptiontype: "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: SmartDeviceApplicationdescription- name: "PPI_EncuestaEncuestaID"waschanged"500in: "path"
description: "InternalEncuestaserver errorRealizada"
schemarequired: truetype: $ref"integer"
format: "#/definitions/GxJsonErrorint32"delete:tagsresponses:200:-PPI_EncuestaoperationIddescription: "DeletePPI_Encuesta"
Successful operation"summary:"EliminarlaEncuestaaRealizarschema:aunClienteenelSistema"parameters$ref: "#/definitions/PPI_Encuesta"-in400:
headerdescription:name: Content-Type"Bad request"typeschema:"string"required$ref: true"#/definitions/GxJsonError" default401:
application/json-indescription: "NotheaderAuthenticated"nameschema:
Authorizationtype$ref: "string#/definitions/GxJsonError"
required404:
true defaultdescription: OAuth"Data<AccesswithToken>thespecifiedkeycouldnotbefound"-in:headerschema: name: GENEXUS-AGENTtype$ref: "string#/definitions/GxJsonError"
500:required:truedescription:"Internalserverdefault:error"SmartDeviceApplication-schema:name:"PPI_EncuestaID"in$ref: "path#/definitions/GxJsonError"
security:
-OAuth2:[]descriptionApiKeyAuth1: "Encuesta Realizada"[]
securityDefinitions:OAuth2: requiredtype: trueoauth2flow:passwordtype: "integer"tokenUrl: https://test.sifco.org/DemoCoopGT/oauth/access_token
scopes:formatExecute: "int32"PermiteelmétodotipoGETresponses:Insert:PermiteelmétodotipoPOST200:Update:Permiteelmétodotipodescription:PUT"Successfuloperation"Delete:PermiteelmétodotipoDELETEschema:FullControl:PermiteelmanejodelosCuatro$ref: "#/definitions/PPI_Encuesta"
204Métodos GET, POST, PUT,DELETE, sobre el Web Service
ApiKeyAuth1:
type:apiKeydescriptionin: "Successfulheaderoperation"name:granttypedefinitions:schemaPPI_Encuesta:
properties: $ref: "#/definitions/PPI_Encuesta"EncuestaID:400description: EncuestaRealizadadescriptiontype: "Bad requestinteger"
format:"int32"schema:PPI_EncuestaDescripcion:$ref:"#/definitions/GxJsonError"description:NombredelaEncuesta401:type:"string"description:"NotAuthenticated"PPI_EncuestaExplicacion:schemadescription: Descripción TécnicadelaEncuesta$reftype: "#/definitions/GxJsonErrorstring"
404:
PPI_EncuestaUsuario:
description: Usuario"Notquefound"ModificalaEncuestaschematype: "string"PPI_EncuestaFechaUltimoCambio:$ref:"#/definitions/GxJsonError"description:Fechadel500:UltimoCambio descriptiontype: "Internalstring"
servererror"format:"date-time"schema:PPI_EncuestaEstado:$refdescription: "#/definitions/GxJsonError"Estadosecurity:-OAuth2:[]type:"boolean"ApiKeyAuth1:[]securityDefinitions:OAuth2PPI_EncuestaScoreMax:
type: oauth2 flowdescription: passwordTotaldelScoretokenUrl: https://test.sifco.org/DemoCoopGT/oauth/access_tokenscopestype: "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:Permiteelmanejode los Cuatro Metodos GET, POST, PUT,DELETE, sobre el Web Service
ApiKeyAuth1:type: "string"
Preguntas:
type: apiKey$ref: "#/definitions/PPI_Encuesta.PreguntasEncuesta"
inrequired:
headername:granttype
definitions:- PPI_EncuestaID
PPI_Encuesta.PreguntasEncuesta:
properties:
PPI_EncuestaIDEncuestaPreguntaID:
description: EncuestaPreguntaRealizadatype: "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 Preguntadescription:UsuarioqueModificala Encuestatype: "integer"typeformat: "stringint32"
PPI_EncuestaFechaUltimoCambioEncuestaPreguntasScore:
description: FechaScore MáximodeldeUltimolaCambioPregunta
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_hashisanidentifierforaspecificversiondescription:ofRespuestaaresource,itisusedforoptimisticconcurrencycheck. It is required for update and delete operations and ignored on insert.type: "string"
PPI_EncuestaRespuestaScore:
description:Valordelatype:Respuesta"string"Preguntastype: "integer"$ref format: "#/definitions/PPI_Encuesta.PreguntasEncuestaint32"
required:
- PPI_EncuestaID
PPI_Encuesta.PreguntasEncuesta:EncuestaRespuestapropertiesx-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 laErrorPreguntatype: "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.
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.