Skip to content

Instantly share code, notes, and snippets.

@giastfader
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save giastfader/ea02b053b0404358db14 to your computer and use it in GitHub Desktop.

Select an option

Save giastfader/ea02b053b0404358db14 to your computer and use it in GitHub Desktop.
//Project definition
{
"name":"Project name",
"url":"http://projectname.com",
"issues":[{issue},{issue}] //see definition below
}
//Issue definition
{
"title":"A nasty bug",
"content":"the login mechanism actually logs out the user",
"status":"OPEN|ONGOING|WONTFIX|RESOLVED",
"assignee":"Johnny Depp",
"reported by":"Tim burton"
"tags":["UI","Backend","Testing"]
}
curl -X PUT http://localhost:9000/document/projects/<id>/.issues%5B0%5D/.status -d '{"data" : "ONGOING"}' -H Content-type:application/json -H X-BB-SESSION:6fce45a1-4f69-443f-ae45-c16270c9c9fc
{
"result":"ok",
"data":{
"@rid":"#23:0",
"@version":5,
"@class":"projects",
"name":"Bugbox",
"url":"http://bugbox.com",
"issues":[
{
"title":"Create a tutorial for single field query",
"content":"Write an awesome tutorial about how a user can retrieve the list of issues for a given project",
"status":"ONGOING",
"assignee":"me",
"reported by":"me",
"tags":[
"Tutorial"
]
}
],
"id":<id>,
"_creation_date":"2014-07-11T13:34:15.015+0200",
"_author":"admin"
},
"http_code":200
}
curl -X PUT http://localhost:9000/document/projects/<id>/.issues%5B0%5D/.tags%5B1%5D -d '{"data" : "Awesome Feature"}' -H Content-type:application/json -H X-BB-SESSION:6fce45a1-4f69-443f-ae45-c16270c9c9fc
{
"result":"ok",
"data":{
"@rid":"#23:0",
"@version":6,
"@class":"projects",
"name":"Bugbox",
"url":"http://bugbox.com",
"issues":[
{
"title":"Create a tutorial for single field query",
"content":"Write an awesome tutorial about how a user can retrieve the list of issues for a given project",
"status":"ONGOING",
"assignee":"me",
"reported by":"me",
"tags":[
"Tutorial",
"Awesome Feature"
]
}
],
"id":<id>,
"_creation_date":"2014-07-11T13:34:15.015+0200",
"_author":"admin"
},
"http_code":200
}
curl -X PUT http://localhost:9000/document/projects/<id>/.issues %5B0%5D/.comments -d '{"data" : [{"commenter":"me","comment":"A nice feature inedeed,mate!"}]}' -H Content-type:application/json -H X-BB-SESSION:6fce45a1-4f69-443f-ae45-c16270c9c9fc
{
"result":"ok",
"data":{
"@rid":"#23:0",
"@version":7,
"@class":"projects",
"name":"Bugbox",
"url":"http://bugbox.wrong",
"issues":[
{
"title":"Create a tutorial for single field query",
"content":"Write an awesome tutorial about how a user can retrieve the list of issues for a given project",
"status":"ONGOING",
"assignee":"me",
"reported by":"me",
"tags":[
"Tutorial",
"Awesome Feature"
],
"comments":[
{
"commenter":"me",
"comment":"A nice feature inedeed,mate!"
}
]
}
],
"id":"1c506c13-a65f-4026-ad5d-c18a3bb2187d",
"_creation_date":"2014-07-11T13:34:15.015+0200",
"_author":"admin"
},
"http_code":200
}
curl -X POST http://localhost:9000/admin/collection/projects -H X-BB-SESSION:6fce45a1-4f69-443f-ae45-c16270c9c9fc
{
"name":"Bugbox",
"url":"http://bugbox.wrong",
"issues":[
{
"title":"Create a tutorial for single field query",
"content":"Write an awesome tutorial about how a user can retrieve the list of issues for a given project",
"status":"OPEN",
"assignee":"me",
"reported by":"me",
"tags":["Tutorial"]
}
]
}
curl -X POST http://localhost:9000/document/projects -d @project.json -H Content-type:application/json -H X-BB-SESSION:6fce45a1-4f69-443f-ae45-c16270c9c9fc
curl -X PUT http://localhost:9000/document/projects/<id>/.url -d '{"data" : "http://bugbox.com"}' -H Content-type:application/json -H X-BB-SESSION:6fce45a1-4f69-443f-ae45-c16270c9c9fc
curl http://localhost:9000/document/projects/<id>/.url -H Content-type:application/json -H X-BB-SESSION:6fce45a1-4f69-443f-ae45-c16270c9c9fc
{
"result":"ok",
"data":{
"result":"http://bugbox.com"
},
"http_code":200
}
curl http://localhost:9000/document/projects/<id>/.issues -H Content-type:application/json -H X-BB-SESSION:6fce45a1-4f69-443f-ae45-c16270c9c9fc
{
"result":"ok",
"data":{
"result":[
{"title":"Create a tutorial for single field query",
"content":"Write an awesome tutorial about how a user can retrieve the list of issues for a given project",
"status":"OPEN",
"assignee":"me",
"reported by":"me",
"tags":["Tutorial"]
}]
},
"http_code":200
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment