Tag

12
Tag

description

Tag. Retrieves all public tags for a project Retrieves all private tags for logged in user. Get All tags for project. Example Resource retrieved. tag1 - PowerPoint PPT Presentation

Transcript of Tag

Page 1: Tag

Tag

Page 2: Tag

Get All tags for project

• Retrieves all public tags for a project

• Retrieves all private tags for logged in user

URL {project-id}/tags

Method GET

Return Code 200 if successful

Example Resource retrieved

<?xml version=”1.0” encoding=”UTF-8”?><tags xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <tag> <name>tag1</name> <description>this is tag1</description> <tagURI>/project/tags/T1<tagURI> <visibility restricted=“true”> <userid>john</userid> <userid>dparikh</userid> </visibility> <count>5</count> <taggedResources href=“http://someurl”/> </tag> <tag> <name>tag2</name> <description>this is tag2</description> <tagURI>/project/tags/T5<tagURI> <visibility restricted=“false”/> <count>9</count> <taggedResources href=“http://someurl”/> </tag></tags>

Page 3: Tag

Get tagged resource for Tag

• Retrieves tagged resources for a tag

URL taggedresourceurl

Method GET

Return Code 200 if successful

Example Resource retrieved

<?xml version=”1.0” encoding=”UTF-8”?><taggedResources> <pagination> <link rel="self" href=“taggedresourceuri" /> <link rel="first" href=" taggedresourceuri" /> <link rel="next" href=“taggedresourceuri?page=1&token=sometoken"/> <link rel="last" href=" taggedresourceuri?page=3&token=sometoken" /> </pagination> <url>http://finance.yahoo.com</url> <url>http://finance.google.com</url></taggedResources>

Page 4: Tag

Create new tag

• Add new public or private tag to project

• If successful returns tagURI

• Optionally tag resources with newly created tag

• Default visibility of tag resource is restricted = “false”

URL {project-id}/tags

Method POST

Return Code 201 if successful

Example POST Resource

<?xml version=”1.0” encoding=”UTF-8”?><tag xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <name>stock</name> <description>this is stock related</description> <visibility restricted=“false”/> <taggedResources> <url>http://finance.yahoo.com</url> <url>http://finance.google.com</url> </taggedResources></tag>

Page 5: Tag

Get tag

• Get Information about the tag resource

• ETag and Last-Modified HTTP headers available

URL {project-id}/tags/{tag-id}

Method GET

Return Code 200 if successful

Example Resource retrieved

<?xml version=”1.0” encoding=”UTF-8”?><tag xmlns=http://jazz.net/xmlns/alm/rdm/v0.1/ uri=”/project/tags/T1”> <name>tag1</name> <description>this is tag1</description> <visibility restricted=“false”/> <count>2</count> <taggedResources href=“http://someurl”/></tag>

Page 6: Tag

Delete tag

• Delete tag identified by {tag-id}

• the request must include specific If- Match or If-Unmodified-Since headers

URL {project-id}/tags/{tag-id}

Method DELETE

Return Code 200 if successful

Page 7: Tag

Update tag

• Update Information about the tag resource

• the request must include specific If- Match or If-Unmodified-Since headers

URL {project-id}/tags/{tag-id}

Method PUT

Return Code 200 if successful

Example Resource retrieved

<?xml version=”1.0” encoding=”UTF-8”?><tag xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <name>tag1</name> <description>this is tag1</description> <visibility restricted=“false”/></tag>

Page 8: Tag

Tag new resource

• Tag new resource url with the tag

URL {project-id}/tags/{tag-id}

Method POST

Return Code 201 if successful

Example POST Resource

<?xml version=”1.0” encoding=”UTF-8”?><tag xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <taggedResources> <url>http://finance.yahoo.com</url> <url>http://finance.google.com</url> </taggedResources></tag>

Page 9: Tag

untag resource

• untag resource

URL {project-id}/tags/{tag-id}? url=http://finance.yahoo.com

Method DELETE

Return Code 200 if successful

Page 10: Tag

Query for a Tag

• Parameters• url= http://finance.yahoo.com, http://finance.yahoo.com• ModifiedSince=dateTime• Name=t

URL {project-id}/tags?

Method GET

Return Code 200 if successful

Example Resource retrieved

<?xml version=”1.0” encoding=”UTF-8”?><tags xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <tag> <name>tag1</name> <description>this is tag1</description> <tagURI>/project/tags/T1<tagURI> <visibility restricted=“true”> <userid>john</userid> <userid>dparikh</userid> </visibility> <count>5</count> <taggedResources href=“http://someurl”/> </tag> <tag> <name>tag2</name> <description>this is tag2</description> <tagURI>/project/tags/T5<tagURI> <visibility restricted=“false”/> <count>9</count> <taggedResources href=“http://someurl”/> </tag></tags>

Page 11: Tag

Apply one or more tags to one or more url

• …

URL

Method

Return Code

Example Resource

TBD

Page 12: Tag

Questions

• How do we get all tags across the project?• How much of the ATOM ?• Is correct RESTful if we have url with query string and

delete / POST– DELETE {project-id}/tags/{tag-id}?url=url1– POST {project-id}/tags/usage?url=url1,url2,url3

• Vs. ‘delicious’-like API, where they utilize GETs and have various actions to do PUT/GET/DELTE functionality