401 Status when loading lens in Camera Kit for Web

Options

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 🔥🔥
    Options

    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.

  • andrew_cf
    Options

    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: 19 🔥
    Options

    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 ?

  • andrew_cf
    Options

    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 🔥🔥
    Options

    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.