Skip to Content
Bonafide MCP is now generally available — read the quickstart
APIsWorked Example

6. Worked example

Your organization is modelled in Bonafide as one BusinessEntity (the brand) and a set of Property entities (the individual hotels). The ID shapes:

RoleBonafide IDDisplay name
Brand BusinessEntityHO-XXXXXXXXXXXX{BRAND_NAME}
Property (sub-entity)HO-NNNNN-CC-RR-XXXXXXXX-N{PROPERTY_NAME}

6.1 Bulk fetch — entire portfolio

Calling the feed endpoint with the brand ID returns the bulk @graph envelope: one QAPage for each property in the dataset.

Request

curl -i \ -H "X-API-Key: bcp_<your_secret_key>" \ -H "Accept: application/ld+json" \ "https://api.bonafide.ai/api/v3/content/HO-XXXXXXXXXXXX/faq.json"

Response — headers (abbreviated)

HTTP/1.1 200 OK Content-Type: application/ld+json Cache-Control: public, max-age=3600 ETag: W/"0123456789abcdef"

Response — body (abbreviated to two members)

{ "@context": "https://schema.org", "@graph": [ { "@type": "QAPage", "identifier": "HO-NNNNN-CC-RR-XXXXXXXX-N", "about": { "@type": "Hotel", "name": "{PROPERTY_NAME}", "url": "https://www.example.com/your-property" }, "mainEntity": [ { "@type": "Question", "name": "What is the guest services phone number at {PROPERTY_NAME}?", "acceptedAnswer": { "@type": "Answer", "text": "The guest services phone number at {PROPERTY_NAME} is +1-000-000-0000." } }, { "@type": "Question", "name": "What are the check-in and check-out times at {PROPERTY_NAME}?", "acceptedAnswer": { "@type": "Answer", "text": "Check-in at {PROPERTY_NAME} begins at 3:00 PM and check-out is at 11:00 AM." } } ] }, { "@type": "QAPage", "identifier": "HO-NNNNN-CC-RR-YYYYYYYY-N", "about": { "@type": "Hotel", "name": "{SECOND_PROPERTY_NAME}", "url": "https://www.example.com/your-second-property" }, "mainEntity": [ /* … further Question / Answer pairs … */ ] } /* … one further QAPage entry per property … */ ] }

6.2 Single-property fetch

Using the property ID directly returns a bare QAPage envelope — same content shape as one @graph member, with @context re-introduced at the top level. This is the shape to embed verbatim inside a <script type="application/ld+json"> tag on the property’s PDP for FAQ-rich-result eligibility.

Request

curl -H "X-API-Key: bcp_<your_secret_key>" \ "https://api.bonafide.ai/api/v3/content/HO-NNNNN-CC-RR-XXXXXXXX-N/faq.json"

Response — body (excerpt: 3 of N questions)

{ "@context": "https://schema.org", "@type": "QAPage", "identifier": "HO-NNNNN-CC-RR-XXXXXXXX-N", "about": { "@type": "Hotel", "name": "{PROPERTY_NAME}", "url": "https://www.example.com/your-property" }, "mainEntity": [ { "@type": "Question", "name": "Is there a charge for using business services at {PROPERTY_NAME}?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, there may be charges for using business services such as printing, fax, and copy services at {PROPERTY_NAME}. Please contact the front desk for current pricing." } }, { "@type": "Question", "name": "Does {PROPERTY_NAME} have a reservation link?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, reservations can be made online through the official website at https://www.example.com/your-property where you can view rates and book rooms directly." } }, { "@type": "Question", "name": "What dining options are available at {PROPERTY_NAME}?", "acceptedAnswer": { "@type": "Answer", "text": "{PROPERTY_NAME} offers on-site dining. Outlets, opening hours, and reservation requirements vary by season." } } /* … further Question / Answer pairs … */ ] }

6.3 Opting in to propertyId

To join Bonafide content back to your internal property records, append ?includePropertyId=true to either the bulk or single-property request. Hotel about objects gain a propertyId field (integer) when the backing record carries one; everything else in the response is byte-identical to the flag-off shape.

Request

curl -i \ -H "X-API-Key: bcp_<your_secret_key>" \ "https://api.bonafide.ai/api/v3/content/HO-XXXXXXXXXXXX/faq.json?includePropertyId=true"

Response — body (excerpt, about only)

{ "@type": "QAPage", "identifier": "HO-NNNNN-CC-RR-XXXXXXXX-N", "about": { "@type": "Hotel", "name": "{PROPERTY_NAME}", "url": "https://www.example.com/your-property", "propertyId": 12345 }, "mainEntity": [ /* … unchanged … */ ] }

6.4 Opting in to category

To surface the feature-type group each question was drawn from, append ?includeCategory=true to either the bulk or single-property request. Each Question object gains a category field (string) positioned between @type and name; the field is omitted when the group name is null or blank and is never emitted as null or "". The flag is purely additive — it does not change which questions are returned.

Request

curl -i \ -H "X-API-Key: bcp_<your_secret_key>" \ "https://api.bonafide.ai/api/v3/content/HO-XXXXXXXXXXXX/faq.json?includeCategory=true"

Response — body (excerpt, mainEntity only)

{ "@type": "QAPage", "identifier": "HO-NNNNN-CC-RR-XXXXXXXX-N", "about": { "@type": "Hotel", "name": "{PROPERTY_NAME}" }, "mainEntity": [ { "@type": "Question", "category": "Pool & Spa", "name": "Does {PROPERTY_NAME} have a pool?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, {PROPERTY_NAME} has an outdoor pool open seasonally." } }, { "@type": "Question", "category": "Parking", "name": "Is parking available at {PROPERTY_NAME}?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, complimentary self-parking is available at {PROPERTY_NAME}." } } ] }
Last updated on