wekan: Error when logging in to Wekan REST API when using Sandstorm Wekan

@kentonv

The problem is, on Standalone Wekan I can login to Wekan REST API using Wekan username and password, but on Sandstorm Wekan when I login with Google Auth, I get error with Sandstorm Webkey when I use Webkey as password. I don’t know what other password I would use.

I tried this way:

  1. On Wekan board create Webkey like in image by @ertanalytics https://github.com/wekan/wekan/wiki/Wekan-Sandstorm-cards-to-CSV-using-Python

Sure by using Python BeautifulSoup etc Wekan html and javascript could probably be parsed and used like in code above, but using REST API would be much nicer.

BTW @ertanalytics when I tried to use your code this way:

sudo apt install python-pip python-bs4 python-selenium python-pandas \
python-bson chromium-chromedriver chromium-browser-l10n

sudo pip install selenium --upgrade

sudo pip install splinter

And copied chromedriver from https://sites.google.com/a/chromium.org/chromedriver/home to my /usr/bin , I got this error, do you know solution to it?

$ python cards-to-csv.py 
Traceback (most recent call last):
  File "cards-to-csv.py", line 62, in <module>
    script = soup.find("script", attrs={'type' : 'text/inject-data'}).children.next()
AttributeError: 'NoneType' object has no attribute 'children'
  1. I tried to login to Wekan REST API on Sandstorm:
curl https://USERNAME:APIKEY@api-ADDRESS.SOMETHING.sandcats.io/users/login \
     -d "username=USERNAME&password=APIKEY"
  1. I get curl response:
{
  "error": "internal-server-error",
  "reason": "Internal server error"
}
  1. On Sandstorm Wekan board console I get this error:
Error: Unauthorized [Unauthorized]
    at Object.Authentication.checkUserId (server/authentication.js:6:21)
    at models/users.js:563:20
    at packages/simple_json-routes.js:98:9
  1. But if I try some other password, I get:
{
  "error": 400,
  "reason": "Match failed"
}

Using Wekan REST API on Sandstorm could make easier:

  • uploading data from scripts etc to Sandstorm Wekan
  • have mobile apps that use Sandstorm Wekan
  • integrations with Huginn
  • incoming Webhooks, etc.

Is there some documentation how with Meteor app like Wekan it would be possible to access info outside of grain, for example so that when importing attachments from Trello, some Sandstorm-compatible way could be used to download Trello attachments to Wekan?

I have not yet tried could EtherCalc API also be used on Sandstorm.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 59 (38 by maintainers)

Commits related to this issue

Most upvoted comments

I think I could try to fix this by exposing /api at sandstorm-pkgdef.capnp file when I get some free time.

I added this info to Wekan wiki

Exporting Wekan board to JSON file with Bash script

  1. On Wekan grain, get Webkey like this:
https://api-URL.SUBDOMAIN.sandcats.io#APIKEY
  1. Modity URL, SUBDOMAIN and APIKEY to this Bash script that exports board to file directly:
curl https://Bearer:APIKEY@api-URL.SUBDOMAIN.sandcats.io/api/boards/sandstorm/export?authToken=#APIKEY > wekanboard.json