Hello,> > Problem:> I’m trying to grab the current logged-in merchant user first_name info to use in our shopify app> > What I’m using:
const [user, setUser] = useState('');
useEffect(() => {
fetch('https://dawn-test-store-sarah.myshopify.com/admin/api/2021-10/users/current.json')
.then(response => response.json())
.then(data => setUser(data));
}, []);
Error Message:
Example Data that should return since all I’m looking for is first_name:
{
"user": {
"id": null,
"first_name": "",
"email": "pixels@jadedpixel.com",
"url": null,
"im": null,
"screen_name": null,
"phone": null,
"last_name": "Shopify API",
"account_owner": false,
"receive_announcements": 0,
"bio": null,
"permissions": [],
"locale": "en",
"user_type": "guest_api",
"phone_validated?": false,
"tfa_enabled?": false
}
}
