[Solved]Pydio API – create workspace

Hi, I’m trying to create a new workspace thought the API. But for some reason I’m receiving

“array_key_exists() expects parameter 2 to be array, null given”

As a response. Does anyone know whats the reason or any workaround…

URL http://127.0.0.1:8082/pydio-core-8.0.2/api/ajxp_conf/create_repository/
JSON:

{
“display”: “dgdfgdfgdfg”,
“DRIVER_OPTIONS”: {
“PATH”: “/”,
“CREATE”:“TRUE”,
“CHMOD_VALUE”:“0666”,
“PURGE_AFTER”: “0”,
“PURGE_AFTER_SOFT”:“0”,
“DATA_TEMPLATE”:"",
“RECYCLE_BIN”: “recycle_bin”,
“PAGINATION_THRESHOLD”:“500”,
“PAGINATION_NUMBER”:“200”,
“REMOTE_SORTING_DEFAULT_COLUMN”:“ajxp_label”,
“REMOTE_SORTING_DEFAULT_DIRECTION”:“asc”,
“UX_DISPLAY_DEFAULT_MODE”:“list”,
“UX_SORTING_DEFAULT_COLUMN”:“natural”,
“UX_SORTING_DEFAULT_DIRECTION”:“ASC”,
“TPL_USER_CAN_CREATE”:“FALSE”,
“TPL_GRP_ADMINS_CAN_CREATE”:“TRUE”,
“TPL_DEFAULT_LABEL”:“caesarpena”
},
“displayStringId”: “”,
“accessType”: “fs”,
“writeable”: “true”,
“enabled”: “false”,
“slug”: “sdfsdfsdfds”,
“isTemplate”: “false”,
“DRIVER”:“fs”
}

BTW I saw a similar question was posted, but the answers were not very helpful.

UPDATE

WIth the V2 API alternative I receive the error below.

"<?xml version="1.0" encoding="UTF-8"?>

Invalid JSON !!
"

curl -X POST
http://127.0.0.1:8082/pydio-core-8.0.2/api/v2/admin/workspaces
-H ‘authorization: Basic Y2Flc2FycGVuYTpQb3dlcm1heGdwMSE=’
-H ‘cache-control: no-cache’
-H ‘content-type: application/json’
-H ‘postman-token: 9aae9246-779f-4071-bf27-3a8f6a7fe9df’
-d ‘{
“id”: “484864646”,
“securityScope”: “caesarpena”,
“slug”: “my-files2”,
“display”: “My Files2”,
“displayStringId”: 432,
“accessType”: “fs”,
“writeable”: false,
“isTemplate”: false,
“parameters”: {
“CREATION_TIME”: 1468593800,
“USER_DESCRIPTION”: 476,
“PATH”: “AJXP_DATA_PATH/personal/AJXP_USER”,
“CREATE”: true,
“RECYCLE_BIN”: “recycle_bin”,
“CHMOD_VALUE”: “0600”,
“DEFAULT_RIGHTS”: “rw”,
“PAGINATION_THRESHOLD”: 500,
“PAGINATION_NUMBER”: 200
},
“features”: {
“metastore.serial”: {
“METADATA_FILE”: “.ajxp_meta”,
“METADATA_FILE_LOCATION”: “infolders”
},
“meta.user”: {
“meta_fields”: “tags”,
“meta_labels”: “Tags”,
“meta_visibility”: “hidden”
},
“meta.filehasher”: [],
“meta.watch”: [],
“meta.syncable”: {
“REPO_SYNCABLE”: true
},
“meta.exif”: {
“meta_fields”: “COMPUTED_GPS.GPS_Latitude,COMPUTED_GPS.GPS_Longitude”,
“meta_labels”: “Latitude,Longitude”
},
“index.lucene”: {
“index_meta_fields”: “tags”,
“repository_specific_keywords”: “AJXP_USER”
}
},
“INFO”: {
“users”: 12,
“shares”: 74
}
}’

UPDATE

I have found the solution by following the postman API testing requests in the following link

The trick is to send the json in as a “value” using “form-data” inside a key named “payload”. This should be included in the documentation…

https://pydio.com/en/pydio-api-v2#!/Provisioning/adminCreateWorkspace