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

Issue with my coding in Wix with the Kroger API #6

Open
Shawn-truve opened this issue Apr 12, 2020 · 0 comments
Open

Issue with my coding in Wix with the Kroger API #6

Shawn-truve opened this issue Apr 12, 2020 · 0 comments

Comments

@Shawn-truve
Copy link

I am hoping I did it correctly, but the products aren't showing up correctly.

This is what I have keyed in the backend and I am unsure how to connect to Kroger...Help Please!!!

import {fetch} from 'wix-fetch';

var myHeaders = new "Headers"();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHBzOi8vYXBpLmtyb2dlci5jb20vdjEvLndlbGwta25vd24vandrcy5qc29uIiwia2lkIjoiWjRGZDNtc2tJSDg4aXJ0N0xCNWM2Zz09IiwidHlwIjoiSldUIn0.eyJzY29wZSI6InByb2R1Y3QuY29tcGFjdCIsImF1dGhBdCI6MTU4NjYzNDgyNTEyMjg3MDg0NiwiYXVkIjoidHJ1dmUtNmM4NzZmYjA1Njc2YjM4ZGI5NmNiNWY1YjUzOGE4ODI3ODQ4OTUwNDAwOTg4NTUwMjU2IiwiZXhwIjoxNTg2NjM2NjI1LCJpYXQiOjE1ODY2MzQ4MjAsImlzcyI6ImFwaS5rcm9nZXIuY29tIiwic3ViIjoiZjVkODFhMzEtYzFjNi00OGJlLWEwNjYtNDQwMjAyNDQxNzhhIn0.RdIxQb6CST5_ZrH6CH3Ut9KqgVCxXVUvwrsJZbKFxHDkRlkM6KX866fkWiCEjPHbOXFm6KxVT7Cg69Efxkj-oCNe4Tq8LJcpZ8Q6tyv6YPTh0L7rTpFndTy-g6YZm2Pe_FLPoCZ7aODr-zBTMY0gm1FUp4AltHcJ4QMarkfbsjJWp1ck44yf-AEs5_fAqPmWz24NH-o9_paEP_iqBYMaqBQAXDKcOkaNIN13_wYm-eQDCK6IUF-uHRopZwgfiNY2m7GWjDWAGLS7GfCZIv2uTSWABu60m0CoVfa6PojYgBoBXT-vv3WwoEtZPwVPjD82Rj7MQrwK9VBOzhnQOTfjgA");
myHeaders.append("Cookie", "bm_sz=8C8E31CDC0CA5D43D7AC44ACC703F82DYAAQnqg2F47mMmZxAQAAVGq7agfuDD16Rm8PDyWHpTt1j8qzwcEbyU9iIwneiGHwXKb+u2nwczOQV/ENYDfWB0wbsdqX9u/HGqm0Avtkf74TJ1N+0ymXyq5bkcz4DYKstIAkHBBhCsiOX6wrwE0nSz3XWL4opCd5N2PI484A80jq8lvKWZr8JKsqkF6UO6Ma; _abck=2FD26AA9490BDEE5335443E4E08F7C7A-1YAAQnqg2F4/mMmZxAQAAVGq7agOKgv1whCrWgB8UK+G9t+9ERZwg4sk/Jb+wAeDB+Ed65gGjxh0rip9kj8BtkG64WAjiNJJYuYvoZEiyRjOA22hJjJkZFoG7LSncVY9JjM/3vr2aqXCPEvP4FZLmA7tiS3h2PdJRepjVA/P+6u7ks8mjBYaK2+FrhDr8tBJJLj15nhjAuU9SgzqawxN4oKoeVyXl/1yVjI2yfYQ8AYMXPNFlSfmWIbzBi4jja63dHYhsFfoapADCJnxpjAWLEjY66il9GvliUUUPIqxVrKWyQDHEwFLWkEng-1~-1~-1; akaalb_Digital_ALB_API=~op=KT_Digital_API_KCVG_F5:api-kcvg|rv=51m=api-kcvg:0|os=75b4a9ec926d2a9e67035451773cec6cid=9c6a903b51e8682e5c77a731fe831a1c");

var urlencoded = new 'URLSearchParams'();

var requestOptions = {
method: 'GET',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};

fetch("https://api.kroger.com/v1/products?filter.term=milk&filter.limit=2", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

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

2 participants
@Shawn-truve and others