Hello, I've read somewhere that you've changed the way of accessing the API. I also see that devel3.0's api.php changed compared to master's. Is there any way you could explain what changes happened, how do we now work with them as I see nothing in the documentation about this.
When I send my requests to the 3.0 api I get this message :
{"jsonrpc":"2.0","error":{"message":"Oops, it looks like this content doesn't exist...","code":0,"data":null},"id":0}Oops, it looks like this content doesn't exist...
I am using python's requests lib and manages to make it work with 2.1 but not 3.0.
Here's how my payload looks like:
DATA_getAccountSearch = {"params":
{
"authToken": API_KEY,
"text": USER_account_name
},
"jsonrpc": "2.0",
"method": STR_getAccountSearch,
"id": rId
}
RESPONSE_getAccountSearch = requests.post(API_URL, json= DATA_getAccountSearch)
Thank you for your work Nuxs and I am looking forward to your response.
Regards
Hello!
sysPass v3 API has slight changes since it won't use the old schema to set action names, it will use controller_name/action instead. You can get the available actions from:
API help will be replied when requesting for a valid action name.
Regards
Thank you for your answer.
Could you just help me out real quick understanding it.
If my url would be https://server-syss.net, what would a proper request look like for an account search?
Does the controller/action path takes the place of the method?
Sorry for being so asking of you, I just wanna make sure I understand.
Just point the URL as before, the only change is done in the JSON payload, where controller/action replaces the method used before.
No worries about asking. I'll post some documentation shortly.
Regards
I am currently using this payload:
API_URL = "https://server-syss.net/sysPass/api.php"
DATA_getAccountSearch = {"params":
{
"authToken": API_KEY,
"text": USER_account_name
}
,
"jsonrpc": "2.0",
"method": "account/search",
"id": rId
}
RESPONSE_getAccountSearch = requests.get(API_URL, json = DATA_getAccountSearch)
I keep getting the router $oops message in the response.text.
Oops, it looks like this content doesn't exist...
Our server logs looks like this:
[26-Jul-2018 16:04:55 Europe/Paris] Config loaded
[26-Jul-2018 16:04:55 Europe/Paris] ------------
[26-Jul-2018 16:04:55 Europe/Paris] Boostrap:api
[26-Jul-2018 16:04:55 Europe/Paris] SP\Modules\Api\Controllers\IndexController::indexAction
[26-Jul-2018 16:04:55 Europe/Paris] Oops, it looks like this content doesn't exist...
[26-Jul-2018 16:04:55 Europe/Paris] #0 [internal function]: SP\Bootstrap->SP{closure}(Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteCollection), Array)
#1 /home/sites/docroot/sysPass/vendor/klein/klein/src/Klein/Klein.php(886): call_user_func(Object(Closure), Object(Klein\Request), Object(Klein\Response), Object(Klein\ServiceProvider), Object(Klein\App), Object(Klein\Klein), Object(Klein\DataCollection\RouteCollection), Array)
#2 /home/sites/docroot/sysPass/vendor/klein/klein/src/Klein/Klein.php(588): Klein\Klein->handleRouteCallback(Object(Klein\Route), Object(Klein\DataCollection\RouteCollection), Array)
#3 /home/sites/docroot/sysPass/lib/SP/Bootstrap.php(458): Klein\Klein->dispatch(Object(Klein\Request))
#4 /home/sites/docroot/sysPass/lib/Base.php(74): SP\Bootstrap::run(Object(DI\Container))
#5 /home/sites/docroot/sysPass/api.php(28): require('/home/sites/...')
#6 {main}
Any idea as to why?
Thanks a lot for your help and time.
Umm, are you making a POST request?
POST request returns me empty text and an error on json. GET request returns me this oops error and error on json. I am looking for an existing user and none of both seems to return me any value I am looking for.
Edit:
Looks much better in the logs with POST request indeed.
[26-Jul-2018 16:48:25 Europe/Paris] Config loaded
[26-Jul-2018 16:48:25 Europe/Paris] ------------
[26-Jul-2018 16:48:25 Europe/Paris] Boostrap:api
[26-Jul-2018 16:48:25 Europe/Paris] initializeCommon
[26-Jul-2018 16:48:25 Europe/Paris] initialize
[26-Jul-2018 16:48:25 Europe/Paris] Attach: SP\Providers\Log\DatabaseLogHandler
[26-Jul-2018 16:48:25 Europe/Paris] Attach: SP\Providers\Log\FileLogHandler
[26-Jul-2018 16:48:25 Europe/Paris] Attach: SP\Providers\Notification\NotificationHandler
[26-Jul-2018 16:48:25 Europe/Paris] Routing call: SP\Modules\Api\Controllers\AccountController::searchAction
[26-Jul-2018 16:48:25 Europe/Paris] SELECT id, userId
FROM Track
WHERE `time` >= ?
AND (ipv4 = ? OR ipv6 = ?)
AND `source` = ?;
[26-Jul-2018 16:48:25 Europe/Paris] SELECT id, actionId, userId, vault, `hash`, token
FROM AuthToken
WHERE actionId = ?
AND token = ? LIMIT 1;
[26-Jul-2018 16:48:25 Europe/Paris] SELECT U.id,
U.name,
U.userGroupId,
UG.name AS userGroupName,
U.login,
U.ssoLogin,
U.email,
U.notes,
U.loginCount,
U.userProfileId,
U.lastLogin,
U.lastUpdate,
U.lastUpdateMPass,
U.preferences,
U.pass,
U.hashSalt,
U.mPass,
U.mKey,
U.isAdminApp,
U.isAdminAcc,
U.isLdap,
U.isDisabled,
U.isChangePass,
U.isChangedPass,
U.isMigrate
FROM User U
INNER JOIN UserGroup UG ON U.userGroupId = UG.id
WHERE U.id = ? LIMIT 1;
[26-Jul-2018 16:48:25 Europe/Paris] SELECT id, `name`, `profile` FROM UserProfile WHERE id = ? LIMIT 1;
[26-Jul-2018 16:48:25 Europe/Paris] SELECT DISTINCT Account.* FROM account_search_v Account WHERE (((Account.isPrivate IS NULL OR Account.isPrivate = 0 OR (Account.isPrivate = 1 AND Account.userId = ?)) AND (Account.isPrivateGroup IS NULL OR Account.isPrivateGroup = 0 OR (Account.isPrivateGroup = 1 AND Account.userGroupId = ?)))) ORDER BY Account.clientName, Account.name ASC LIMIT ?, ?;
I still seem to get no body in my response.
According to logs my requests is atleast occuring the way it should be I believe. It may be a problem on my side, I'll explore and come back if I manage to fix anything.
Thanks a lot for supporting.
Ok, I'll check out the code for any issue (mobile phone has limited capabilities...)
Hey, here you have a request example:
POST http://localhost:10080/api.php
Accept: */*
Cache-Control: no-cache
Content-Type: application/json
{ "jsonrpc": "2.0", "method": "account/search", "params": { "authToken": "12b9027d24efff7bfbaca8bd774a4c34b45de35e033d2b192a88f4dfaee5c233", "text": "Google" }, "id": 1 }
And it returns:
POST http://localhost:10080/api.php
HTTP/1.1 200 OK
Date: Thu, 26 Jul 2018 17:37:04 GMT
Server: Apache/2.4.25 (Debian)
Content-Length: 667
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json; charset=utf-8
{
"jsonrpc": "2.0",
"result": {
"itemId": 0,
"result": [
{
"id": 2,
"userId": 1,
"userGroupId": 1,
"userEditId": 0,
"name": "Google",
"clientId": 1,
"categoryId": 1,
"login": "admin",
"url": "https:\/\/google.com",
"notes": "blablacar",
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"isPrivate": 0,
"isPrivateGroup": 0,
"dateEdit": "2018-07-04 23:08:15",
"passDate": 1528323890,
"passDateChange": 0,
"parentId": 0,
"categoryName": "Web",
"clientName": "Google",
"userGroupName": "Admins",
"userName": "sysPass Admin",
"userLogin": "admin",
"userEditName": "",
"userEditLogin": "",
"num_files": 1,
"publicLinkHash": null,
"publicLinkDateExpire": null,
"publicLinkTotalCountViews": null,
"countView": 33
}
],
"resultCode": 0,
"count": 1
},
"id": 1
}
Regarding your latest post it seems that your request was replied SP\Modules\Api\Controllers\AccountController::searchAction by the correct controller/action, so you should receive a response.
Hello Nuxs!
Once again, thank you for helping out.
What is weird is that the response to my request seems to be empty:

My USER_account_name (text) is "all" and I conveniently have an account with this field:

I am using the KEY of sysPass Admin which has I believe enough authorizations to make it work:

This is my php_err.log:

Any idea what I could be doing wrong?
Could test the python code against the demo site? (you can create any auths you do need).
The log does not display any error indeed, just debugging information.
Here's my code:
API_KEY= "ea65b34f6e73ad918c4191edd3f7edc69533ac543eb5caef70b05213ff694a5d"
API_URL= "http://demo-beta.syspass.org:10080/api.php"
USER_account_name= "dd_client"
rId= 1
DATA_getAccountSearch = {"params":
{
"authToken": API_KEY,
"text": USER_account_name
}
,
"jsonrpc": "2.0",
"method": "account/search",
"id": rId
}
rId+=1
RESPONSE_getAccountSearch = requests.post(API_URL, json = DATA_getAccountSearch, ver\
ify=False)
JSON_getAccountSearch = RESPONSE_getAccountSearch.json()
with open("demo_res.json","w") as dm:
json.dump(JSON_getAccountSearch, dm , sort_keys=True, indent=4, separators=(',',\
': '))
My code seems to run fine on the demo however I am probably missing out on how the search works. I have created an account with the clientName "dd_client", when I am looking for "text": "dd_client" I get a json payload (atleast) with a lot of existing accounts that doesn't seem to refer to anything I am looking for (Except the one I am looking for but paired with it seems every other existing account?):
JSON response
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"count": 29,
"itemId": 0,
"result": [
{
"categoryId": 3,
"categoryName": "Database",
"clientId": 9,
"clientName": "BC cloud",
"countView": 208,
"dateEdit": "2018-07-18 11:23:39",
"id": 22,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "sadmin",
"name": "Application Server",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 20,
"passDate": 1529416278,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 3,
"categoryName": "Database",
"clientId": 9,
"clientName": "BC cloud",
"countView": 43,
"dateEdit": "2018-07-18 11:26:05",
"id": 23,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "sadmin",
"name": "DB Server",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1528147934,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 9,
"clientName": "BC cloud",
"countView": 3,
"dateEdit": null,
"id": 32,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "xadmin",
"name": "VPN Server",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1531914623,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 11,
"categoryName": "dd_cat",
"clientId": 12,
"clientName": "dd_client",
"countView": 1,
"dateEdit": null,
"id": 35,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "dd_user",
"name": "dd",
"notes": "dd_notes",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1532703827,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "dd_url",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 8,
"categoryName": "card",
"clientId": 1,
"clientName": "Google Inc",
"countView": 22,
"dateEdit": null,
"id": 24,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "test",
"name": "mio test",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1528725071,
"passDateChange": 0,
"publicLinkDateExpire": 1530003935,
"publicLinkHash": "888bf8c8b667e3c50f588ae3b1035dfb976a24866265fe60d1f4cf3113e5",
"publicLinkTotalCountViews": 1,
"url": "127.0.0.1",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 1,
"categoryName": "Web Service",
"clientId": 1,
"clientName": "Google Inc",
"countView": 51,
"dateEdit": "2018-06-04 17:52:53",
"id": 2,
"isPrivate": 0,
"isPrivateGroup": 1,
"login": "st",
"name": "test",
"notes": "Very long account password",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1522147713,
"passDateChange": 0,
"publicLinkDateExpire": 1532281300,
"publicLinkHash": "415b52915c5e3230a0e394bd756094d9ac17a3410558657bf62cc328efb3",
"publicLinkTotalCountViews": 2,
"url": "test",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 2,
"categoryName": "File Transfer",
"clientId": 2,
"clientName": "Mac Donald's",
"countView": 24,
"dateEdit": null,
"id": 10,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "test",
"name": "test",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1522620314,
"passDateChange": 0,
"publicLinkDateExpire": 1530003941,
"publicLinkHash": "9be75a988d5330368f142c54315d867043cdae2287ba759356f5b3654157",
"publicLinkTotalCountViews": 2,
"url": "test",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 2,
"clientName": "Mac Donald's",
"countView": 16,
"dateEdit": "2018-04-11 11:57:39",
"id": 13,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "aaa",
"name": "testyogrupouser",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1523447646,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "aaa",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 2,
"userGroupName": "Team123",
"userId": 6,
"userLogin": "user1",
"userName": "user1"
},
{
"categoryId": 3,
"categoryName": "Database",
"clientId": 4,
"clientName": "Microsoft",
"countView": 28,
"dateEdit": "2018-04-01 22:06:08",
"id": 8,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "user",
"name": "blob",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1521977130,
"passDateChange": 0,
"publicLinkDateExpire": 1532281297,
"publicLinkHash": "48f4efe3ffcafc365d066d54d34cffa58fc9bfa047566dd367b7359bb063",
"publicLinkTotalCountViews": 1,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 9,
"categoryName": "o365",
"clientId": 4,
"clientName": "Microsoft",
"countView": 15,
"dateEdit": "2018-06-30 19:45:40",
"id": 25,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "[email protected]",
"name": "Doe John",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1530387940,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 4,
"clientName": "Microsoft",
"countView": 10,
"dateEdit": "2018-04-13 23:45:57",
"id": 15,
"isPrivate": 1,
"isPrivateGroup": 0,
"login": "fsdfsd",
"name": "gigel",
"notes": "",
"num_files": 1,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1523663112,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 2,
"categoryName": "File Transfer",
"clientId": 4,
"clientName": "Microsoft",
"countView": 3,
"dateEdit": null,
"id": 28,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "teste",
"name": "Senha",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1530100147,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "wfwqfddwqd",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 5,
"categoryName": "Special/Various",
"clientId": 4,
"clientName": "Microsoft",
"countView": 5,
"dateEdit": "2018-06-14 15:42:43",
"id": 26,
"isPrivate": 1,
"isPrivateGroup": 1,
"login": "demo",
"name": "test",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1528990920,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "test.com",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 9,
"categoryName": "o365",
"clientId": 4,
"clientName": "Microsoft",
"countView": 1,
"dateEdit": null,
"id": 31,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "a",
"name": "test",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1531472431,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 4,
"clientName": "Microsoft",
"countView": 7,
"dateEdit": "2018-04-11 12:00:23",
"id": 12,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "aaa",
"name": "testyosolomio",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1523447550,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "aaa",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 5,
"categoryName": "Special/Various",
"clientId": 4,
"clientName": "Microsoft",
"countView": 7,
"dateEdit": null,
"id": 6,
"isPrivate": 0,
"isPrivateGroup": 1,
"login": ".",
"name": "Tjaka",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1521820845,
"passDateChange": 1529539200,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 2,
"categoryName": "File Transfer",
"clientId": 4,
"clientName": "Microsoft",
"countView": 4,
"dateEdit": null,
"id": 14,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "wer",
"name": "yrdy",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1523616824,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "34",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 6,
"clientName": "Peter Pan",
"countView": 23,
"dateEdit": null,
"id": 9,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "useraccount",
"name": "00_Testaccount",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1522615806,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "10.0.0.8",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 1,
"categoryName": "Web Service",
"clientId": 6,
"clientName": "Peter Pan",
"countView": 2,
"dateEdit": null,
"id": 17,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "username",
"name": "abecedar",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1524470212,
"passDateChange": 0,
"publicLinkDateExpire": 1532342679,
"publicLinkHash": "befc18790f1d638362c61fff326730e1339e447d7e27873c20bd96cbe007",
"publicLinkTotalCountViews": 0,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 3,
"userGroupName": "Nerds",
"userId": 10,
"userLogin": "domnu",
"userName": "domnu"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 6,
"clientName": "Peter Pan",
"countView": 3,
"dateEdit": "2018-07-24 07:03:00",
"id": 33,
"isPrivate": 1,
"isPrivateGroup": 0,
"login": "with space is okay",
"name": "without_ _omer_",
"notes": "this is a \"test\" password for a spacy name",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1532415649,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 5,
"clientName": "Private - Mario",
"countView": 16,
"dateEdit": "2018-03-22 22:38:38",
"id": 3,
"isPrivate": 1,
"isPrivateGroup": 0,
"login": "admin",
"name": "[email protected]",
"notes": "SSH user for ultra mega mega money database server",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 1,
"parentId": 0,
"passDate": 1521758306,
"passDateChange": 1529452800,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "ssh://[email protected]:22",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 5,
"clientName": "Private - Mario",
"countView": 9,
"dateEdit": null,
"id": 4,
"isPrivate": 1,
"isPrivateGroup": 0,
"login": "admin",
"name": "copy - [email protected]",
"notes": "SSH user for ultra mega mega money database server",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 1,
"parentId": 0,
"passDate": 1521758403,
"passDateChange": 1529452800,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "ssh://[email protected]:22",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 5,
"clientName": "Private - Mario",
"countView": 4,
"dateEdit": "2018-03-22 22:44:04",
"id": 5,
"isPrivate": 1,
"isPrivateGroup": 0,
"login": "admin",
"name": "copy of copy of copy - [email protected]",
"notes": "SSH user for ultra mega mega money database server",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 1,
"parentId": 4,
"passDate": 1521758635,
"passDateChange": 1529452800,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "ssh://[email protected]:22",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 7,
"categoryName": "License",
"clientId": 5,
"clientName": "Private - Mario",
"countView": 1,
"dateEdit": null,
"id": 34,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "test",
"name": "myserver",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1532595410,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "10.0.0.1",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 8,
"clientName": "ssh",
"countView": 10,
"dateEdit": null,
"id": 20,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "user",
"name": "apa",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1525252301,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "url",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 4,
"categoryName": "Operating System",
"clientId": 8,
"clientName": "ssh",
"countView": 4,
"dateEdit": "2018-05-28 16:45:11",
"id": 21,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "123",
"name": "test",
"notes": "123",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1527525911,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 6,
"categoryName": "webspace",
"clientId": 8,
"clientName": "ssh",
"countView": 5,
"dateEdit": "2018-04-18 18:56:16",
"id": 16,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "dfgsdfgsdfg",
"name": "test",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1524077758,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 3,
"categoryName": "Database",
"clientId": 8,
"clientName": "ssh",
"countView": 7,
"dateEdit": "2018-04-24 17:04:30",
"id": 19,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "MyUser",
"name": "testwebserver",
"notes": "This is only a test",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1524589307,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "https://myserver.my.own",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
},
{
"categoryId": 5,
"categoryName": "Special/Various",
"clientId": 7,
"clientName": "Test Client Please Ignore",
"countView": 1,
"dateEdit": null,
"id": 11,
"isPrivate": 0,
"isPrivateGroup": 0,
"login": "testing",
"name": "Test Account Please Ignore",
"notes": "",
"num_files": 0,
"otherUserEdit": 0,
"otherUserGroupEdit": 0,
"parentId": 0,
"passDate": 1523304404,
"passDateChange": 0,
"publicLinkDateExpire": null,
"publicLinkHash": null,
"publicLinkTotalCountViews": null,
"url": "www.example.com",
"userEditId": 0,
"userEditLogin": "",
"userEditName": "",
"userGroupId": 1,
"userGroupName": "Admins",
"userId": 2,
"userLogin": "demo",
"userName": "sysPass demo"
}
],
"resultCode": 0
}
}
The search works like on the web UI, so you won't be able to search for a client name, since this field is not included on the filtering. You would need to search for client id instead.
It seems that you're sending an empty text for searching.
Hello @nuxsmin ,
When I am using the web UI I do manage to find it though:

So it feels like it does not really act the same way I believe. Or what is client id? It's the number in the clientID in the response? Hence I need to know it in advance which I believe is quite difficult, I'd have to load the complete thing then do some kind of filtering.

My API requests seem to reach the server but I don't receive anything.
On the demo, the text I search does not seem to matter at all as it just returns me the same set of info every time, be it by name, clientid or anything. I am using the exact same payload you gave me beforehand with the exception of the API key which is:

And results in:

Or same with this:

Also, what are API authorization's passwords for? I don't seem to see their use anywhere.
Thank you for your future response and your hard work.
EDIT: Be it with curl I have the same problem.
curl -H 'Content-Type: application/json' -X POST -d '{"jsonrpc": "2.0","method":"account/search", "id" : "1", "params": {"authToken": "ea65b34f6e73ad918c4191edd3f7edc69533ac543eb5caef70b05213ff694a5d", "text": "VPN Server"}}' http://demo-beta.syspass.org:10080/api.php
It does work with 2.1 but not 3.0.
Hello, I've just fixed a wrong behaviour, since search text was not being used, so any searching using a text returned the full recordset.
Also, what are API authorization's passwords for? I don't seem to see their use anywhere.
The API authorization's password is needed when you are dealing with items that need encryption, since sysPass needs to use the master password. This password is used to generate a derived key to encrypt the real master password.
Thank you for your future response and your hard work.
You're welcome ;)
Thanks for the feedback and testing!
Regards
Glad you could fix the problem Nuxs! Im left with my empty response from my server though but we're going to run some test and try to fix it since it probably is a problem on our end.
Keep up the good work and best of luck.
Regards
Edit: If you still have an idea about why this could be happening please don't hesitate to point it out x). Could be a problem with the database? Any file holding the path to db?
Continues on #1000