Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
api:api_applications_id_flags_id [2014/07/02 00:43] – [HEAD, GET] Lauri Elevantapi:api_applications_id_flags_id [2021/01/21 12:51] (current) – external edit 127.0.0.1
Line 4: Line 4:
 ===== HEAD, GET ===== ===== HEAD, GET =====
  
-Use the ''HEAD'' verb to test if the application in question has this flag set (identified by the flag's ID). A request with the ''GET'' verb returns some additional information about the flag ( FIXME ).+Use the ''HEAD'' verb to test if the application in question has this flag. A request with the ''GET'' verb returns some additional information about the flag association (date assigned etc.)
 + 
 +**Note that this will not return the flag itself**, but rather represents the relationships between the application and the flag. Follow the flag URI in the response to retrieve further information about the flag in question.
  
-Note that this **does not delete the flag itself**, only removing it's association with the application in question. 
  
 ==== Syntax ==== ==== Syntax ====
Line 13: Line 14:
   Host: apply.example.edu   Host: apply.example.edu
   Authorization: DREAM apikey="..."   Authorization: DREAM apikey="..."
 +
  
 ==== Response headers ==== ==== Response headers ====
Line 18: Line 20:
   Content-Type: application/json   Content-Type: application/json
   Content-Length: 1234   Content-Length: 1234
 +
  
 ==== Response codes ==== ==== Response codes ====
  
 | ''200 OK'' | The flag is set | | ''200 OK'' | The flag is set |
-| ''404 Not Found'' | The flag was not set |+| ''404 Not Found'' | The flag does not exist | 
 +| ''404 Not Found'' | The flag was not set to this application |
  
 +
 +==== Response example ====
 +
 +  {
 +    "assigned": "2014-07-11T09:24:51+00:00",
 +    "flag": "/api/applications/flags/6"
 +  }
  
 ===== PUT ===== ===== PUT =====
  
-Set the flag (identified by it's ID) to the application in question. +Set flag (identified by it's ID) to the application in question.  **This requires that the flag already exists.** Use ''POST'' [[api:api_applications_flags|/api/applications/flags]] to create a flag first, then this API call will allow you to ''PUT'' the flag (identified by it's code) to any number of applications.  
 + 
 +In other words, this will not create a new flag, but create a relationship (association) between an existing flag and an application.
  
 ==== Syntax ==== ==== Syntax ====
Line 43: Line 56:
  
 | ''200 OK'' | Flag was successfully set | | ''200 OK'' | Flag was successfully set |
 +| ''404 Not Found'' | The flag does not exist |
  
 ===== DELETE ===== ===== DELETE =====
  
 Remove the flag (identified by it's ID) from the application in question. Remove the flag (identified by it's ID) from the application in question.
 +
 +Note that this **does not delete the flag itself**, only removing it's association with the application in question.
 +
  
 ==== Syntax ==== ==== Syntax ====
Line 63: Line 79:
  
 | ''204 No Content'' | Flag was successfully deleted | | ''204 No Content'' | Flag was successfully deleted |
 +| ''404 Not Found'' | The flag does not exist | 
 +| ''404 Not Found'' | The flag was not set to this application |