# Crear WebService

##### <span class="api-method" data-method="POST">POST</span> https://api.service24gps.com/api/v1/createWebservice

Crea un WebService a nivel distribuidor.

<details class="mb-m" id="bkmrk-body-parametersparam"><summary class="text-muted">Ver parámetros de solicitud:</summary>

<div><table class="table" style="height: 405px;"><tbody><tr style="height: 57px;"><td style="width: 188px; height: 57px;">apikey</td><td style="width: 320px; height: 57px;">**(Requerido)** Llave de autorización para uso de los Servicios Web.</td><td style="width: 301px; height: 57px;"><span data-darkreader-inline-color="" role="presentation" style="padding-right: 0.1px; color: #3366ff;">25sdsd234234aa93sdsdsd37c70118e72</span></td></tr><tr style="height: 41px;"><td style="width: 188px; height: 41px;">token</td><td style="width: 320px; height: 41px;">**(Requerido)** Token devuelto por el método getToken.</td><td style="width: 301px; height: 41px;"><span data-darkreader-inline-color="" style="color: #3366ff;">wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==</span></td></tr><tr style="height: 41px;"><td style="width: 188px; height: 41px;">nombre</td><td style="width: 320px; height: 41px;">**(Requerido)** Nombre del repetidor.</td><td style="width: 301px; height: 41px;"><span data-darkreader-inline-color="" style="color: #3366ff;">Mi repetidor de datos</span></td></tr><tr style="height: 58px;"><td style="width: 188px; height: 58px;">tipo\_transmision</td><td style="width: 320px; height: 58px;">**(Requerido)** Tipo de transmisión. Valores aceptados: TCP, UDP, SOAP, RESTful.</td><td style="width: 301px; height: 58px;"><span data-darkreader-inline-color="" style="color: #3366ff;">TCP</span></td></tr><tr style="height: 75px;"><td style="width: 188px; height: 75px;">tipo\_envio</td><td style="width: 320px; height: 75px;">**(Opcional)** Tipo del envío, valores aceptados: JSON, XML, string, otro. Si no se proporciona este campo, su valor por defecto será JSON.</td><td style="width: 301px; height: 75px;"><span data-darkreader-inline-color="" style="color: #3366ff;">json</span></td></tr><tr><td style="width: 188px;">host</td><td style="width: 320px;">**(Requerido)** Dirección Host por establecer al WebService, este campo es obligatorio **sólo si** el tipo de transmisión seleccionado es SOAP o RESTful. Representa el valor del host necesario para realizar la comunicación de envío.</td><td style="width: 301px;"><span data-darkreader-inline-color="" style="color: #3366ff;">https://192.168.1.100/my-endpoint</span></td></tr><tr><td style="width: 188px;">ip</td><td style="width: 320px;">**(Requerido)** Dirección IP por establecer al WebService, este campo es obligatorio **sólo si** el tipo de transmisión seleccionado es TCP o UDP. Representa el valor de la IP necesaria para realizar la comunicación de envío.</td><td style="width: 301px;"><span data-darkreader-inline-color="" style="color: #3366ff;">192.168.1.100</span></td></tr><tr><td style="width: 188px;">port</td><td style="width: 320px;">**(Requerido)** Puerto por establecer al WebService, este campo es obligatorio **sólo si** el tipo de transmisión seleccionado es TCP o UDP. Representa el valor del puerto necesario para realizar la comunicación de envío.</td><td style="width: 301px;"><span data-darkreader-inline-color="" style="color: #3366ff;">80</span></td></tr></tbody></table>

</div></details>##### Solicitud de ejemplo:

```shell
curl -X 'POST' \
  'https://api.service24gps.com/api/v1/createWebservice' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'apikey=25sdsd234234aa93sdsdsd37c70118e72' \
  -F 'token=wfszR/oPIQKjt5HT5NgjDnZ2SAZQ==' \
  -F 'nombre=Mi repetidor de datos' \
  -F 'tipo_transmision=RESTful' \
  -F 'host=https://192.168.1.100/my-endpoint' \
  -F 'tipo_envio=json'
```

##### Respuesta de ejemplo:

```JSON
{
   "status":200,
   "data":{
      "idws":151,
      "webservice":"Mi repetidor de datos",
      "tipo_transmision":"RESTful",
      "tipo_envio":"json",
      "host":"https://192.168.1.100/my-endpoint"
   }
}
```

<details class="mb-m" id="bkmrk-ver-par%C3%A1metros%3A-par%C3%A1" open="open"><summary class="text-muted">Ver campos de respuesta:</summary>

<div><table class="table" id="bkmrk-campo-descripci%C3%B3n-fo" style="width: 809px; height: 574px;"><tbody><tr style="height: 47px;"><th style="width: 174px; height: 47px;">Campo</th><th style="width: 392px; height: 47px;">Descripción

</th><th style="width: 243px; height: 47px;">Formato</th></tr><tr style="height: 41px;"><td style="width: 174px; height: 41px;">idws</td><td style="width: 392px; height: 41px;">Identificador único del repetidor del WebService.

</td><td style="width: 243px; height: 41px;">Entero</td></tr><tr style="height: 69px;"><td style="width: 174px; height: 69px;">webservice</td><td style="width: 392px; height: 69px;">Nombre del repetidor del WebService, no se admiten duplicados.

</td><td style="width: 243px; height: 69px;">Cadena de Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">tipo\_transmision</td><td style="width: 392px; height: 47px;">Tipo de transmisión establecido al WebService

</td><td style="width: 243px; height: 47px;">Cadena de Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">tipo\_envio</td><td style="width: 392px; height: 47px;">Tipo de envío establecido al WebService

</td><td style="width: 243px; height: 47px;">Cadena de Texto</td></tr><tr><td style="width: 174px;">host</td><td style="width: 392px;">Dirección Host establecida al WebService.

</td><td style="width: 243px;">Cadena de Texto</td></tr><tr style="height: 69px;"><td style="width: 174px; height: 69px;">ip</td><td style="width: 392px; height: 69px;">Dirección IP establecida al WebService.

</td><td style="width: 243px; height: 69px;">Cadena de Texto</td></tr><tr style="height: 47px;"><td style="width: 174px; height: 47px;">port</td><td style="width: 392px; height: 47px;">Puerto establecido al WebService.

</td><td style="width: 243px; height: 47px;">Entero</td></tr></tbody></table>

</div>#####  

##### En la plataforma Partners se puede apreciar la creación del nuevo WebService:

[![image-1726510453429.png](https://docs.redgps.com/uploads/images/gallery/2024-09/scaled-1680-/image-1726510453429.png)](https://docs.redgps.com/uploads/images/gallery/2024-09/image-1726510453429.png)

</details>