[Bps-public-commit] rt-extension-rest2 branch, rest2-doc-examples, repushed

Craig Kaiser craig at bestpractical.com
Thu Mar 29 12:56:43 EDT 2018


The branch rest2-doc-examples was deleted and repushed:
       was f519d52ad2ac37113b1b11283eb85c9e2de08c0a
       now 90144a38c9b4c5bba07f66b1cf4f32926724f774

1:  f519d52 ! 1:  c36f58c Asset doc examples
    @@ -1,6 +1,6 @@
     Author: craig Kaiser <craig at bestpractical.com>
     
    -    Asset and User endpoint doc examples
    +    Asset doc examples
     
     diff --git a/lib/RT/Extension/REST2.pm b/lib/RT/Extension/REST2.pm
     --- a/lib/RT/Extension/REST2.pm
    @@ -34,7 +34,9 @@
     +    curl -X POST -H "Content-Type: application/json" -u 'root:password'
     +        -d '{"Name" : "Asset From Rest",
     +            "Catalog" : "General assets",
    -+            "Description" : "Some content"}'
    ++            "Description" : "Some content",
    ++            "CustomFields" : {"MyCustomField" : "Value On Create"}
    ++            }'
     +        'https://myrt.com/REST/2.0/asset'
     +
     +    # Search Assets
    @@ -51,33 +53,4 @@
      =head3 Catalogs
      
          GET /catalogs/all
    -@@
    -     GET /user/:name/history
    -         retrieve list of transactions for user
    - 
    -+=head3 User examples
    -+
    -+Below are some examples using the enpoints above.
    -+
    -+    # Search
    -+    curl -X POST -H "Content-Type: application/json"
    -+        -d '[{"field": "Name", "operator": "LIKE", "value" : "MyUserName"}]'
    -+        -u 'root:password' 'https://myrt.com/REST/2.0/users'
    -+
    -+    # Create
    -+    curl -X POST -H "Content-Type: application/json"
    -+        -d '{"Name": "TestUser", "Nickname": "Tester"}'
    -+        -u 'root:password' 'https://myrt.com/REST/2.0/user'
    -+
    -+    # Update
    -+    curl -X PUT -H "Content-Type: application/json"
    -+        -d '{"Name": "NewName",  "CustomFields" : {"MyCF" : "NewValue"} }'
    -+        -u 'root:password' 'https://myrt.com/REST/2.0/user/TestUser'
    -+
    -+    # Delete
    -+    curl -X DELETE -u 'root:password'
    -+        'http://localhost:8080/REST/2.0/user/MyUser'
    -+
    - =head3 Groups
    - 
    -     GET /groups?query=<JSON>
    +
-:  ------- > 2:  ef3f0df User doc examples
-:  ------- > 3:  90144a3 Queue doc examples



More information about the Bps-public-commit mailing list