API errorCode:400 rootPath mismatch

I’m getting this error message when making a call to the nfs file api. The content of the request is as follows:

General
Request URL:http://localhost:8100/nfs/file/test.txt/false
Request Method:GET
Status Code:400 Bad Request
Remote Address:127.0.0.1:8100

Response Headers
Connection:keep-alive
Content-Length:70
Content-Type:application/json; charset=utf-8
Date:Sun, 10 Jul 2016 02:34:52 GMT

Request Headers
Accept:/
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8,fr;q=0.6
Authorization:Bearer eyJhbGciOiJIUzI1NiJ9.eyJpZCI6IjFmTDR0Ry92QVJQL0FXRVd3cXVKNUR1UVA4a2VINmdBK0tZM1pKV3RpcVU9In0.7jojQhqTeSXAXx747e-fGCeFkQ-d9uQfEUVMuwRCJU4
Connection:keep-alive
Host:localhost:8100

Exact response is:
{“errorCode”:400,“description”:“Invalid request. ‘rootPath’ mismatch”}

I can use the auth endpoint without problem but all calls to nfs/directory and nfs/file gives a similar error. The version of the launcher is v0.5.1.

Anyone’s got a similar problem?

On a side note, is maidsafe.readme.io the official api doc? Is it up to date?

The docs at readme.io aren’t up to date yet. This RFC houses the 0.5 spec to follow.

Looks to me like you’re missing the folder spec (app or drive) ahead of the file location (corresponding to the older is public that was on the end of the api).

such that the API request should look more like:

http://localhost:8100/nfs/<app or drive>/file/test.txt

I was running into the same problems before trying this.

3 Likes

Thanks, it works now. I like how the POST, GET and DELETE are now more alike, it made my code much cleaner.

2 Likes

Yes! It’s now looking like WebDAV and following HTTP standards better. That was the goal.

2 Likes