kibrock

Add folder Api v2

Recommended Posts

Hello.

I use the api v2 and try to add a folder to synchronize the POST request: 

"curl -X POST -H "Content-Type: application/json" -d '{"path": "c:\temp"}' http://localhost:8899/api/v2/folders",

but get an error: "curl: (3) [globbing] unmatched close brace/bracket in column 8",

at the same time GET request: "curl -X GET http://localhost:8899/api/v2/folders"  works fine,

help me please, what am I doing wrong?

P.S. Sorry for my English.

Share this post


Link to post
Share on other sites

@kibrock Some comments on your request:

  1. Some versions of CURL may be sensitive to the order of arguments. So I suggest next order: curl <username-pass> <method> <url> <content-type> <request content>
  2. When requesting any method except GET, you need to supply cookies and security token. Please see below a sample of changing the device name with POST method.
curl -c cookie -u admin:pass http://localhost:8888/api/v2/token

curl -b cookie -u admin:pass -X POST http://localhost:8888/api/v2/owner?token=jFMy-j2Mtoy3-ucVeB5lcE6A41nGNqqlrToTeflPoIgPpCxeF6qNXXzk1lYAAAAA -H "Content-Type:application/json" -d '{"username":"John Doe","devicename":"Test Machine"}'

cookie is the file to store cookies, while "token" value is received in /api/v2/token call.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now