API

The API provides access to the basic features and allows you to integrate Passwork in your infrastructure or develop your own client.

General
  1. Data is sent by HTTP POST requests
  2. API End Point — https://passwork.me/api2/
  3. API uses JSON format
  4. We strongly recommend to use SSL connection
Libs
  1. Javascript API Connector
  2. .Net API Connector
Server reply

{
    'response' : { ... },  
    'errorCode' : '...', 
    'errorMessage' : '...'
}      
        

In case of error response is false.

All further examples relate to response field.

Open session

/api2/openSession

Creates new session. Returns session code which has to be passed with each request. Session is automatically expired each few minuts.

Parameters:

email
User e-mail (login)

password
Authorization password

Server reply:

Success

 {
    'code' : '...', // session code
    'hash' : '...'  // md5 hash of a secret word
 }
        

Field сode has to be passed with each further request to the API.
Field hash helps to check if a secrect word is correct.


Errors:

response = false

Wrong login or password.

errorCode = ban

User is banned due often fails to open a new session.

Get data

/api2/getData

Gets all passwords

Parameters:

session
Session code

Server reply:

Data

  {
    'user' : '...', // id user
    'groups' : [{  // array of groups
        'id' : '...', // id group
        'name' : '...', // group name
        'passwordCrypted' : '...',  // encrypted group password
        'folders' :[{  // array of folders
            'id' : '...',  // id folder
            'name' : '...', // folder name
            'passwords' : [{ // array of passwords
                'id' : '...', // id password
                'categoryId' : '...', // id folder
                'groupId' : '...', // id group,
                'name' : '...', // password name
                'login' : '...', 
                'url', : '...',
                'description' : '...',
                'cryptedPassword' : '...', // encrypted password
                }]
            }]
        }],
        'passwords' : [{ // array of passwords
            'id' : '...', // id password
            'categoryId' : '...', // id folder
            'groupId' : '...', // id group,
            'name' : '...', // password name
            'login' : '...', 
            'url', : '...',
            'description' : '...',
            'cryptedPassword' : '...', // encrypted password
            }]
        }]
  }
        

Errors:

{
    'response' : false,
    'errorCode' : 'expired',
    'errorMessage' : 'Session expired'
}            
        

Session is expired. Needs opening a new session using openSession.

Update and insert

These API functions are in testing stage and will be published soon.

Example

  1. Open a new session using openSession
  2. Load all data using getData
  3. Ask user for his secrect word
  4. Decrypt group password (using the secrect word) groups[X].passwordCrypted
  5. Decrypt data (using group password) groups[X].folders[Y].passwords[Z].cryptedPassword