Get snippets of current user
GET http://{host}:{port}/{context}/rest/snippets/1.0/snippets
curl -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets
Get starred snippets of current user
GET http://{host}:{port}/{context}/rest/snippets/1.0/snippets/starred
curl -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets/starred
Browse snippets
GET http://{host}:{port}/{context}/rest/snippets/1.0/snippets/browse
curl -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets/browse
Browse snippets of user
GET http://{host}:{port}/{context}/rest/snippets/1.0/snippets/browse?username={username}
curl -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets/browse?username=johndoe
Get snippets of category
GET http://{host}:{port}/{context}/rest/snippets/1.0/snippets/categories/{guid}
curl -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets/categories/2f7c939e273f4d29b60f08f9a508298a
Get snippet by GUID
GET http://{host}:{port}/{context}/rest/snippets/1.0/snippets/{guid}
curl -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets/87dec410f4404d4ca43dc4772a8bd0f0
Get comment by GUID
GET http://{host}:{port}/{context}/rest/snippets/1.0/snippets/{snippetGuid}/comments/{commentGuid}
curl -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets/87dec410f4404d4ca43dc4772a8bd0f0/comments/6b90147977bb42f782610f0211a94cfc
Create snippet
POST http://{host}:{port}/{context}/rest/snippets/1.0/snippets
curl -X POST -u username:password -H "Content-Type:application/json" -d '{ "name" : "Example Snippet", "files" : [{ "name" : "example.sql", "content" : "SELECT * FROM examples" }] }' http://bitbucket.example.com/rest/snippets/1.0/snippets
Create comment
POST http://{host}:{port}/{context}/rest/snippets/1.0/snippets/{guid}/comments
curl -X POST -u username:password -H "Content-Type:application/json" -d '{ "text" : "This is a comment..." }' http://bitbucket.example.com/rest/snippets/1.0/snippets/87dec410f4404d4ca43dc4772a8bd0f0/comments
Update snippet
PUT http://{host}:{port}/{context}/rest/snippets/1.0/snippets/{guid}
curl -X PUT -u username:password -H "Content-Type:application/json" -d '{ "name" : "Example Snippet", "description" : "Example description...", "categories" : [ "Example Category" ], "files" : [{ "name" : "example.sql", "content" : "SELECT * FROM examples" }] }' http://bitbucket.example.com/rest/snippets/1.0/snippets/87dec410f4404d4ca43dc4772a8bd0f0
Update comment
PUT http://{host}:{port}/{context}/rest/snippets/1.0/snippets/{snippetGuid}/comments/{commentGuid}
curl -X PUT -u username:password -H "Content-Type:application/json" -d '{ "text" : "This is another comment..." }' http://bitbucket.example.com/rest/snippets/1.0/snippets/87dec410f4404d4ca43dc4772a8bd0f0/comments/6b90147977bb42f782610f0211a94cfc
Delete snippet
DELETE http://{host}:{port}/{context}/rest/snippets/1.0/snippets/{guid}
curl -X DELETE -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets/87dec410f4404d4ca43dc4772a8bd0f0
Delete comment
DELETE http://{host}:{port}/{context}/rest/snippets/1.0/snippets/{snippetGuid}/comments/{commentGuid}
curl -X DELETE -u username:password -H "Content-Type:application/json" http://bitbucket.example.com/rest/snippets/1.0/snippets/87dec410f4404d4ca43dc4772a8bd0f0/comments/6b90147977bb42f782610f0211a94cfc