Testimonials

Creating a Testimonial

Endpoint

POST /v1/testimonials

Parameters

Name Description
rating_total required Total rating
product_id required Product
customer_id required Customer (optional if logged in)
rating_look Look rating
rating_usability Usability rating
rating_support Support rating
message Message
firstname Firstname
lastname Lastname
city City
country Country
sex Gender
private_message Private message
approved Approved
stared Stared

Request

curl "https://capi.storyblok.com/v1/testimonials" -d '{"rating_total":"2","product_id":40433,"customer_id":7246,"rating_look":"2","rating_usability":"2","rating_support":"2"}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=cK1YJoe7pJYgwcCOjsFlQQtt" \

Response

{
  "id": 3886,
  "product_id": 40433,
  "approved": null,
  "created_at": "2018-07-04T16:57:20.000Z",
  "message": "",
  "firstname": null,
  "lastname": null,
  "city": null,
  "country": null,
  "sex": false,
  "customer_id": 7246,
  "private_message": "",
  "rating_look": 2,
  "rating_usability": 2,
  "rating_support": 2,
  "rating_total": 2,
  "stared": null
}

Deleting a Testimonial

Endpoint

DELETE /v1/testimonials/:id

Request

curl "https://capi.storyblok.com/v1/testimonials/3888" -d '' -X DELETE \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=WpIKEjJkZ4GcJ8M3avqp2Qtt" \

Getting a Testimonial

Endpoint

GET /v1/testimonials/:id

Request

Query Parameters

page=0
curl "https://capi.storyblok.com/v1/testimonials/3884?page=0" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=QOrBSZanIQ2HVzPHlTWhNwtt" \

Response

{
  "id": 3884,
  "product_id": 40430,
  "approved": false,
  "created_at": "2018-07-04T16:57:19.000Z",
  "message": "",
  "firstname": "",
  "lastname": "",
  "city": "",
  "country": "",
  "sex": false,
  "customer_id": 7245,
  "private_message": "",
  "rating_look": 1,
  "rating_usability": 2,
  "rating_support": 3,
  "rating_total": 2,
  "stared": false
}

Getting a list of testimonials

Endpoint

GET /v1/testimonials

Parameters

Name Description
page Current page of testimonials
approved 1 to get only approved. 0 to get all
product_id Filter by product id
customer_id Filter by customer id
term Search by term

Request

Query Parameters

page=0
curl "https://capi.storyblok.com/v1/testimonials?page=0" -X GET \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=W6f9bVzG08oVxlLXragjegtt" \

Response

[

]

Updating a Testimonial

Endpoint

PUT /v1/testimonials/:id

Parameters

Name Description
rating_look Look rating
rating_usability Usability rating
rating_support Support rating
rating_total required Total rating
product_id required Product
customer_id required Customer
message Message
firstname Firstname
lastname Lastname
city City
country Country
sex Gender
private_message Private message
approved Approved
stared Stared

Request

curl "https://capi.storyblok.com/v1/testimonials/3887" -d '{"rating_look":"2"}' -X PUT \
	-H "Accept: application/json" \
	-H "Content-Type: application/json"
	-H "Authorization: Token token=nT6Q3k1YZhpoJGWQFpnbZAtt" \

Response

{
  "id": 3887,
  "product_id": 40435,
  "approved": false,
  "created_at": "2018-07-04T16:57:20.000Z",
  "message": "",
  "firstname": "",
  "lastname": "",
  "city": "",
  "country": "",
  "sex": false,
  "customer_id": 7247,
  "private_message": "",
  "rating_look": 2,
  "rating_usability": 2,
  "rating_support": 3,
  "rating_total": 2,
  "stared": false
}