How to get user photo in JavaScript using Graph API?

%3CLINGO-SUB%20id%3D%22lingo-sub-195680%22%20slang%3D%22en-US%22%3EHow%20to%20get%20user%20photo%20in%20JavaScript%20using%20Graph%20API%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-195680%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EWhen%20a%20GET(%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fusers%2F%22%20rel%3D%22noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fusers%2F%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%7B%7Buser_id%7D%7D%20%2Fphoto%2F%24value)%20request%20is%20made%2C%20the%20response%20data%20will%20be%20written%20with%20the%20same%20characters%20as%20this%20image.%26nbsp%3BAfter%20converting%20to%20base64%2C%20I%20tried%20blob%20format%20but%20the%20picture%20does%20not%20appear.%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20538px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F34519i7FD0AC73F91E8DA6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image%20erro.png%22%20title%3D%22image%20erro.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Deleted
Not applicable

When a GET(https://graph.microsoft.com/v1.0/users/ {{user_id}} /photo/$value) request is made, the response data will be written with the same characters as this image. After converting to base64, I tried blob format but the picture does not appear.



image erro.png

 

0 Replies