2 operations. Every schema and example on this page is generated from the platform contract.
Every testimonial on the authenticated store, with whatever star rating the shop owner has put on each. A null rating means it has not been scored: the words still show on the shop page and the average is untouched.
instagramfacebookmessageothercurl -G "https://www.membber.com/api/v1/testimonials" \
-H "Authorization: Bearer $MEMBBER_TOKEN" \
--data-urlencode "store_id=6659c139-0000-4000-8000-d0c500000066"import { createMembberClient } from "@membber/sdk-ts";
const membber = createMembberClient({
getAccessToken: () => process.env.MEMBBER_TOKEN,
});
const { data, error } = await membber.raw.GET("/api/v1/testimonials", {
params: { query: { store_id: "6659c139-0000-4000-8000-d0c500000066" } },
});
if (error) {
// Typed error envelope: { error: { code, message, requestId } }
throw new Error(`${error.error.code}: ${error.error.message}`);
}
console.log(data);import MembberSwift
let client = MembberClient(
serverURL: MembberClient.productionServerURL,
tokenProvider: { session.accessToken }
)
let response = try await client.api.listStoreTestimonials(
query: .init(storeId: "6659c139-0000-4000-8000-d0c500000066")
).ok.body.json
print(response){
"testimonials": [
{
"id": "00000d1b-0000-4000-8000-d0c500000000",
"body": "<body>",
"author_handle": "<author_handle>",
"source": "instagram",
"said_on": "<said_on>",
"rating": 1,
"is_published": true
}
]
}/api/v1/testimonialsThe rating is the SHOP OWNER'S, applied to praise that was given without a number. A rated testimonial counts towards the star average on her shop page, weighted alongside verified purchase reviews. Passing null clears the score and returns the testimonial to showing its words only.
instagramfacebookmessageothercurl -X PATCH "https://www.membber.com/api/v1/testimonials" \
-H "Authorization: Bearer $MEMBBER_TOKEN" \
-H "Idempotency-Key: 1f0e2d3c-4b5a-4678-9abc-def012345678" \
-H "Content-Type: application/json" \
-d '{
"store_id": "6659c139-0000-4000-8000-d0c500000066",
"testimonial_id": "302814bb-0000-4000-8000-d0c500000030",
"rating": 1
}'import { createMembberClient } from "@membber/sdk-ts";
const membber = createMembberClient({
getAccessToken: () => process.env.MEMBBER_TOKEN,
});
const { data, error } = await membber.raw.PATCH("/api/v1/testimonials", {
body: {
store_id: "6659c139-0000-4000-8000-d0c500000066",
testimonial_id: "302814bb-0000-4000-8000-d0c500000030",
rating: 1
},
headers: { "Idempotency-Key": crypto.randomUUID() },
});
if (error) {
// Typed error envelope: { error: { code, message, requestId } }
throw new Error(`${error.error.code}: ${error.error.message}`);
}
console.log(data);import MembberSwift
let client = MembberClient(
serverURL: MembberClient.productionServerURL,
tokenProvider: { session.accessToken }
)
let response = try await client.api.rateStoreTestimonial(
body: .json(.init(
storeId: "6659c139-0000-4000-8000-d0c500000066",
testimonialId: "302814bb-0000-4000-8000-d0c500000030",
rating: 1
))
).ok.body.json
print(response){
"testimonial": {
"id": "00000d1b-0000-4000-8000-d0c500000000",
"body": "<body>",
"author_handle": "<author_handle>",
"source": "instagram",
"said_on": "<said_on>",
"rating": 1,
"is_published": true
}
}