-
Notifications
You must be signed in to change notification settings - Fork 17
RESTful API password
Guido Krömer edited this page Jan 25, 2014
·
2 revisions
A key for en- and decrypting the passwords has to be provided with each request, in this example the key is zxcvbn.
Get all passwords.
Example request api/1/password/zxcvbn
Example response
{
"status": 200,
"response": [
{
"name": "My social network password",
"user": "MyUserName",
"password": "MyEncryptedSecretPassword",
"id": 1
},
{
"name": "My GitHub password",
"user": "MyGitHubUserName",
"password": "MyEncryptedSecretPassword",
"id": 2
},
]
}
Create a password
Example request api/1/password/zxcvbn
{
"name": "MyFancyWebmailProvider",
"url": "http:\/\/myfancewebmail.com"
"email": "i@myfancewebmail.com"
"password": "zxcvbn111"
}
Example response
{
"status": 201,
"response": 3 /*Id of newly added password*/
}
Get a password by its id
Example request api/1/password/zxcvbn/3
Example response
{
"status": 200,
"response": {
"name": "MyFancyWebmailProvider",
"url": "http:\/\/myfancewebmail.com"
"email": "i@myfancewebmail.com"
"password": "zxcvbn111"
}
}
Edit a password specified by its id
Example request api/1/password/zxcvbn/3
{
"name": "MyFancyWebmailProvider",
"url": "http:\/\/myfancewebmail.com"
"email": "i@myfancewebmail.com"
"password": "MyNewPassword"
}
Example response
{
"status": 200,
"response": 3
}
Delete a password specified by its id
Example request api/1/password/zxcvbn/3
Example response
{
"status": 200,
"response": 3
}