POST /cabaprop/connect
This service connects a Mapaprop account with Cabaprop. Using the customer's apiKey, it authenticates against the Cabaprop integration API, stores the resulting token for future publications and notifies the customer (internal Slack + email) that their account has been connected.
| Resource information | |
|---|---|
| Authentication | Required (service token) |
| HTTP Method | POST |
| Response | JSON |
| Version | 1 |
Resource URL
https://api-cabaprop.mapaprop.com/property-api/cabaprop/connect
Headers
| Header | Required | Description |
|---|---|---|
authorization | yes | Cabaprop static service token. If it does not match, the request is rejected. |
Content-Type | yes | application/json |
Parameters (body request)
The body is a JSON with the following fields:
| Key | Type | Required | Description |
|---|---|---|---|
custId | number | yes | Customer identifier in Mapaprop. |
apiKey | string | yes | Customer API key in Cabaprop. Sent as the x-api-key header to the Cabaprop API for authentication. |
brand | string | yes | Brand/real estate agency associated with the connection. Part of the stored app name (cabaprop___{brand}). |
name | string | yes | Customer name. Used in Slack and email notifications. |
email | string | yes | Customer email. Destination of the connection confirmation email. |
Sample code
POST /property-api/cabaprop/connect
Host: api-cabaprop.mapaprop.com
Content-Type: application/json
authorization: {access_token}
{
"custId": 1,
"apiKey": "tu-api-key-de-cabaprop",
"brand": "Mapaprop",
"name": "Mapaprop INC",
"email": "info@mapaprop.com"
}
Response
On success, returns a 200 with the response body from the Cabaprop authentication API, which includes the integration token.
{
"token": "{access_token}"
}
As a side effect of a successful connection, the service:
- Stores the token and connection data associated with the
custIdand brand. - Sends an internal Slack notification (support channel).
- Sends a confirmation email to the specified
email.
Errors
| Status | Body | Cause |
|---|---|---|
| 500 | {"message":"Unauthorized"} | The authorization header does not match the Cabaprop service token. |
| 500 | "Error Post cabaprop intration auth : {error}" | Authentication against the Cabaprop integration API failed (e.g., invalid apiKey). |
| 500 | "Error DynamoDB put Item : {error}" | The token was obtained but the connection could not be stored. |
| 500 | "Error to send notification to Slack/Email : {error}" | The connection was stored but sending the Slack notification or email failed. |