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

Resource information
AuthenticationRequired
HTTP MethodPUT
ResponseString

Resource URL

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

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: text/plain; charset=utf-8 Content-Length: 0 Authorization: cfdjAsjfGwekhpICjkasgOIkaKMSGMAOkskOAIKTJEMUQskgalkslkgGJKJaMASJgflGKIEjaMAS


Response

The JSON returned depends on whether the execution was successful or gave an error during the execution.

ObjectFieldTypeRequiredDescription
Response SuccesssuccessStringyesA text indicating whether a post/put hit was made on the property
Response ErrorerrorStringyesA text indicating the exact error that occurred.

Sample code

Sample for implementation

`import axios from 'axios'; //imports

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

//function const propertyHit = async (custId: any, propertyId:any , currentUrl:any ) => { try { const apiUrl = propertyHitAccess.baseURL; const headers = { 'Content-Type': 'text/plain', Authorization: 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)`