This webservice is used to submit a hit to the property.

Resource information
AuthenticationRequired (JWT con scope internal-portal)
HTTP MethodPUT
ResponseString

Resource URL

https://property-api.mapaprop.com/property/hit

Autenticacion

Se requiere un token JWT en el header Authorization: Bearer {access_token}. El token debe incluir el scope internal-portal; de lo contrario el servicio responde 403.

Parameters body request.

KeyTypeRequiredDescription
custIdStringyesthe customer id identifier
propertyIdStringyesthe property id identifier
brandIdStringyesbrand or system sending data
originStringyesoriginating portal sending the data
originUrlHitStringyesurl of the property from which the data is sent
brandCountryStringyescountry code to store customer's local time

Sample code

PUT https://property-api.mapaprop.com/property/hit Host: property-api.mapaprop.com Content-Type: application/json Authorization: Bearer {access_token}


Response

El servicio devuelve un texto plano segun el resultado.

StatusCuerpoSignificado
200Put hit.Se incremento el contador de hits del dia para la propiedad.
200Post first hit.Se registro el primer hit de la propiedad.
403{ "message": "Scope required: internal-portal" }El token no tiene el scope internal-portal.
500Error parametersFalta alguno de los parametros obligatorios del body.

Sample code

Sample for implementation

`import axios from 'axios'; //imports

//credentials const propertyHitAccess = { baseURL: 'https://property-api.mapaprop.com/property/hit', token: '{access_token}' }

//function const propertyHit = async (custId: any, propertyId:any , currentUrl:any ) => { try { const apiUrl = propertyHitAccess.baseURL; const headers = { 'Content-Type': 'application/json', Authorization: Bearer ${propertyHitAccess.token}, }; const data = { custId: custId, propertyId: propertyId, brandId: yourBrandName, origin: yourWebsite, originUrlHit: currentUrl, brandCountry: 'ar', //countryCode }; const response = await axios.put(apiUrl, data, { headers }); // console.log('Respuesta de la solicitud PUT:', response.data); } catch (error) { //console.error('Error al realizar la solicitud PUT:', error); } }; export { propertyHit };

//call the function propertyHit(response.data.customerId, response.data.propertyId, window.location.href)`