Hello,
I am trying to figure out how to integrate UGC reviews with a Gatsby ecommerce project. I’ve installed the plugin https://www.gatsbyjs.com/plugins/gatsby-source-yotpo/ and configured the app key and secret.
Currently, I don’t have any reviews so I tried to POST one using VS Code’s REST Client. Below is the POST request.
POST /v1/widget/reviews HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: api.yotpo.com
@appKey={{$processEnv GATSBY_YOTPO_APP_KEY}}
{
"appkey": "{{appKey}}",
"sku": "prod_01G0V7ZAXNFTYBFY5H8Z4SS0JG",
"product_title": "Medusa T-Shirt",
"product_description": "Reimagine the feeling of a classic T-shirt. With our cotton T-shirts, everyday essentials no longer have to be ordinary.",
"product_url": "http://brandiqa.netlify.com/na/t-shirt",
"product_image_url": "https://medusa-public-images.s3.eu-west-1.amazonaws.com/tee-black-front.png",
"display_name": "John Smith",
"email": "micwanyoike@gmail.com",
"is_incentivized": true,
"review_content": "It’s really good. Fits nicely",
"review_title": "Great T-Shirt",
"review_score": 5
}
However, I received the following response:
HTTP/1.1 301 Moved Permanently
Server: awselb/2.0
Date: Wed, 20 Apr 2022 11:20:39 GMT
Content-Type: text/html
Content-Length: 134
Connection: close
Location: https://api.yotpo.com:443/v1/widget/reviews
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
</body>
</html>
The ecommerce server and storefront are both running locally. Kindly let me know what I could be doing wrong.
Thanks in advance.