REST API

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
{ "size": 1, "limit": 25, "isLastPage": true, "values": [{ "guid": "87dec410f4404d4ca43dc4772a8bd0f0", "name": "Example Snippet", "description": "Example description...", "categories": [{ "guid": "2f7c939e273f4d29b60f08f9a508298a", "name": "Example Category" }], "isVisible": true, "isPublic": false, "userId": 1, "createdAt": 1379175213548, "updatedAt": 1379175745710, "files": [{ "guid": "bda2ce737fce4cc19ba00cafc5c9f33d", "name": "example.sql", "content": "SELECT * FROM examples" }], "comments": [{ "guid": "6b90147977bb42f782610f0211a94cfc", "text": "This is a comment...", "userId": 1, "createdAt": 1431174442000, "updatedAt": 1431174442000 }] }], "start": 0 }

 

Get starred snippets of current user

Browse snippets

 

Browse snippets of user

 

Get snippets of category

 

Get snippet by GUID

Get comment by GUID

Create snippet

Create comment

Update snippet

Update comment

Delete snippet

Delete comment

Â