POST returned 401 with error: Unauthorized

Comments

3 comments

  • Official comment
    Pooja Pandey

    Just to mention, if anyone else is also facing this issue. Please only use your API key to authenticate and not username/password. 

    Comment actions Permalink
  • Pooja Pandey

    Hey Andrea,

     

    Thanks for writing at Planet Community.

    Would you be able to write to support@planet.com with your email address used to register yourself on our platform so we can look into your access?

    Thank you!

    Best Regards,

    Pooja

    0
    Comment actions Permalink
  • Ryan Avery

    Pooja Pandey How can we authenticate with `planet init` like before? Planet init is not working for me anymore even though it appears to work when I run it:

    (porder)
    # rave at rave-desktop in ~ [13:30:56]
    → planet init
    Email: ravery@ucsb.edu
    Password:
    initialized

    I'm using the latest version of the planet package, 1.4.3

     

    When I try to view my subscriptions I can't do so on my desktop but this command works on my laptop with the exact same .planet.json file (there's no discernible difference between my laptop OS , planet version, api key, etc.)

    # rave at rave-desktop in ~ [13:15:03]
    → planet analytics subscriptions list
    Traceback (most recent call last):
    File "/home/rave/miniconda3/envs/porder/bin/planet", line 8, in <module>
    sys.exit(main())
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/planet/scripts/v1.py", line 452, in list_subscriptions
    response = cl.list_analytic_subscriptions(feed_id)
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/planet/api/client.py", line 393, in list_analytic_subscriptions
    return self._get(url, models.Subscriptions, params=params).get_body()
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/planet/api/models.py", line 45, in get_body
    resp = self._dispatcher._dispatch(self.request)
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/planet/api/dispatch.py", line 155, in _dispatch
    return _do_request(self.session, request)
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/planet/api/dispatch.py", line 125, in _do_request
    check_status(resp)
    File "/home/rave/miniconda3/envs/porder/lib/python3.6/site-packages/planet/api/utils.py", line 90, in check_status
    raise exception(response.text)
    planet.api.exceptions.InvalidAPIKey: {"code":401,"message":"unauthenticated for invalid credentials"}

    0
    Comment actions Permalink

Please sign in to leave a comment.