Generating TokenΒΆ

Create a short lived access token to be used for authorized API calls. Typically a token will last 3600 seconds(one hour).

var client = MeshyClient.Initialize(accountName, publicKey);
var connection = client.LoginWithPassword(username, password);

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique identifier for user or device.
password : string, required
User secret credentials for login. When anonymous it is static as nopassword.
var client = MeshyClient.initialize(accountName, publicKey);

var meshyConnection = await client.login(username,password);

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique identifier for user or device.
password : string, required
User secret credentials for login. When anonymous it is static as nopassword.
POST https://auth.meshydb.com/{accountName}/connect/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded

   client_id={publicKey}&
   grant_type=password&
   username={username}&
   password={password}&
   scope=meshy.api offline_access

(Form-encoding removed, and line breaks added for readability)

Parameters

accountName : string, required
Indicates which account you are connecting to.
publicKey : string, required
Public identifier of connecting service.
username : string, required
Unique identifier for user or device.
password : string, required
User secret credentials for login. When anonymous it is static as nopassword.

Responses

200 : OK
  • Generates new credentials for authorized user.

Example Result

{
   "access_token": "ey...",
   "expires_in": 3600,
   "token_type": "Bearer",
   "refresh_token": "ab23cd3343e9328g"
}
400 : Bad request
  • Token is invalid.
  • Client id is invalid.
  • Grant type is invalid.
  • User is no longer active.
  • Invalid Scope.
  • Username is invalid.
  • Password is invalid.
429 : Too many request
  • You have either hit your API or Database limit. Please review your account.