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

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

Resource URL

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

Authentication

A JWT token is required in the Authorization: Bearer {access_token} header. The token must include the internal-portal scope; otherwise the service responds with 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

The service returns plain text according to the result.

StatusBodyMeaning
200Put hit.The daily hit counter for the property was incremented.
200Post first hit.The first hit for the property was recorded.
403{ "message": "Scope required: internal-portal" }The token does not have the internal-portal scope.
500Error parametersOne or more required body parameters are missing.

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)`