Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import/Export Feature #21

Open
duxy opened this issue May 23, 2020 · 3 comments
Open

Import/Export Feature #21

duxy opened this issue May 23, 2020 · 3 comments

Comments

@duxy
Copy link

duxy commented May 23, 2020

Is your feature request related to a problem? Please describe.
I need a way to import existing reviews when migrating stores from other platforms.

Describe the solution you'd like
A nice import feature in the admin app is desirable.

Describe alternatives you've considered
Don't know an easy way to import external reviews, found a way by developing an external app and use graphql, but a native solution will be the best.
Additional context
If Export is to much, just Import feature will be ok.

@polishq
Copy link
Contributor

polishq commented May 28, 2020

Hi @duxy , this feature is in our backlog but not currently scheduled for development.

Currently the best way to import reviews is by sending requests to VBASE (for example using Postman). You'll need to send PUTs to the first endpoint to store the actual review data, then populate the lookup table with the second endpoint:

First endpoint - Review data (stored by product ID):
https://infra.io.vtex.com/vbase/v2/{Account}/{Workspace}/buckets/vtex.reviews-and-ratings/productReviews/files/{productId}

List<Review>
Review{
Id: int (required)
CacheId: int (required)
ProductId: string (required)
Rating: int (required, number of stars from 1-5)
Title: string
Text: string
ReviewerName: string
ShopperId: string
ReviewDateTime: string
VerifiedPurchaser: boolean
Sku: string
Approved : boolean
Location : string
}

Second endpoint - Lookup table:
https://infra.io.vtex.com/vbase/v2/{Account}/{Workspace}/buckets/vtex.reviews-and-ratings/productReviews/files/productLookup

Dictionary<int, string> -- values are <review.Id, review.ProductId>

For the first endpoint, you'll want to make one PUT request per product ID, with a list of all the reviews for that product. If you make two PUTs for the same product ID, the earlier one will be overwritten. Example PUT:

[{"Id":28,"CacheId":28,"ProductId":"123","Rating":4,"Title":null,"Text":null,"ReviewerName":null,"ShopperId":"testshopper1","ReviewDateTime":"09/26/2019 14:52:00","VerifiedPurchaser":false,"Sku":null,"Approved":false},{"Id":29,"CacheId":29,"ProductId":"123","Rating":4,"Title":null,"Text":null,"ReviewerName":null,"ShopperId":"testshopper1","ReviewDateTime":"09/26/2019 14:56:55","VerifiedPurchaser":false,"Sku":null,"Approved":false},{"Id":30,"CacheId":30,"ProductId":"123","Rating":4,"Title":null,"Text":null,"ReviewerName":null,"ShopperId":"testshopper1","ReviewDateTime":"10/04/2019 15:00:56","VerifiedPurchaser":false,"Sku":null,"Approved":false},{"Id":31,"CacheId":31,"ProductId":"123","Rating":4,"Title":null,"Text":null,"ReviewerName":null,"ShopperId":"testshopper1","ReviewDateTime":"10/04/2019 15:01:10","VerifiedPurchaser":false,"Sku":null,"Approved":false},{"Id":32,"CacheId":32,"ProductId":"123","Rating":4,"Title":null,"Text":null,"ReviewerName":null,"ShopperId":"testshopper1","ReviewDateTime":"10/04/2019 15:07:48","VerifiedPurchaser":false,"Sku":null,"Approved":false},{"Id":33,"CacheId":33,"ProductId":"123","Rating":4,"Title":null,"Text":null,"ReviewerName":null,"ShopperId":"testshopper1","ReviewDateTime":"10/04/2019 15:08:43","VerifiedPurchaser":false,"Sku":null,"Approved":false},{"Id":34,"CacheId":34,"ProductId":"123","Rating":4,"Title":null,"Text":null,"ReviewerName":null,"ShopperId":"testshopper1","ReviewDateTime":"10/04/2019 15:19:26","VerifiedPurchaser":false,"Sku":null,"Approved":false}]

@mroffe
Copy link

mroffe commented Jul 23, 2020

Hi @polishq !
Can you help me know where to get the {Region}?
Regards!

@polishq
Copy link
Contributor

polishq commented Jul 24, 2020

Hi @mroffe , I appreciate the question. There's actually a newer endpoint you can use that doesn't require you to know the region.

Review data:
https://infra.io.vtex.com/vbase/v2/{Account}/{Workspace}/buckets/vtex.reviews-and-ratings/productReviews/files/{productId}

Lookup table:
https://infra.io.vtex.com/vbase/v2/{Account}/{Workspace}/buckets/vtex.reviews-and-ratings/productReviews/files/productLookup

I've edited the instructions above to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants