0

I've been told by support to write here, so:

I'm using the "useradd" endpoint to add users for my app. However, after the user is successfully created, the token I'm getting does not actually work.

Weirdly enough I can see it in the dashboard, but shortly after I try using it on the client JS code, it disappears from there.

Seems like some sort of weird bug to me, but not sure. ‍♂️

Also: When I either regenerate the token on the dashboard by hand before trying it, or add it after it disappears, that one would work.

ZeeCoder
  • 1,001
  • 9
  • 17
  • I'm suspecting it may have to do with something of token platform, which is not shown on the dashboard, but the default seems to be android? Not sure. – ZeeCoder Sep 22 '20 at 15:21
  • Also seems like dashboard tokens won't work unless the app id is exactly the app id, not "any unique string" as the docs claim. – ZeeCoder Sep 22 '20 at 15:28

2 Answers2

0

Post your code and how you are generating token. Whatever unique string you use for generating token MUST also be used when you call setAppName

Read tutorials here https://mesibo.com/documentation/tutorials/get-started/first-app/

mesibo
  • 3,970
  • 6
  • 25
  • 43
  • Yeah I know that bit, and I've tried various "app ids", but non of them work. The latest one is "web", because an angry support told me that should work. (which it didnt') This is the request POST https://api.mesibo.com/api.php?op=useradd&token=mytoken&addr=asd123%3A%3AViktor&appid=web&expiry=105120000 For this one I've used "web" with javascript as well. I've also tried random string and the actual app id as the "app id", nothing worked, acts the same. – ZeeCoder Sep 23 '20 at 08:00
0

Turns out if was because the backend normalises whatever app id I use. So "GoneWithTheWind" becomes "gonewiththewind", and hence if you use "GoneWithTheWind" in the JS setAppName call, it won't work.

(And your token will disappear for some reason as well.)

Leading- and trailing whitespaces are stripped as well.

Also, numeric "app id" is fine, just make sure that it's used as a string in the JS code, so for example: setAppName("4567").

ZeeCoder
  • 1,001
  • 9
  • 17