Heads up! We're sunsetting this forum to streamline our community space.

join us on Discord for support, updates, and all things Snap AR! See you there!
Sign up for our live Camera Kit office hour on July 17 @ 9:30am (PT) / 4:30pm (GMT)

401 Status when loading lens in Camera Kit for Web

Hi there, I've got started with Camera Kit for web and currently have a project where I'm able to view the camera feed, however whenever I try to load a lens I get a 401 response saying the request was not authenticated. I've triple checked my API token and the lens ID and lens group IDs, and tried using the default included lens groups, but have still not had any luck. I have set up the project using webpack, and am opening the index.hml page in Chrome on a Mac at the moment. Any help would be greatly appreciated!

Tagged:

Answers

  • Michael Mase
    Michael Mase Posts: 66 🔥🔥

    Hi @andrew_cf! Are you using the staging token? The production token will not be active until you have an app approved for use in a production environment.

  • Hi Michael, I'm currently using the staging API token, but am using the regular Lens Group and Lens IDs. Do they have separate staging tokens as well, or are those the correct IDs to be using?

  • JacekC
    JacekC Posts: 26 👻

    Lens Group and Lens IDs should be the same for the staging and production token.

    Can you confirm that Sample Page works for you https://camera-kit.snapchat.com/websdk/sample/basic ?

  • Hi JacekC, thanks for that confirmation, that's what I expected. The sample page does work for me on a variety of browsers

  • Michael Mase
    Michael Mase Posts: 66 🔥🔥

    Hi @andrew_cf! Are you still having this issue? If so, be sure that you have Camera Kit enabled for the version of the app that is live for your staging/production environments.

Categories