tools/rest-scripts/legal.http (99 lines of code) (raw):

# -------HTTP REST CLIENT ------- # https://marketplace.visualstudio.com/items?itemName=humao.rest-client # # Purpose: Sample requests for Legal Service # ----------------------- # OAUTH (Variables) # ----------------------- ### @login_base = login.microsoftonline.com/{{TENANT_ID}} @oauth_token_host = {{login_base}}/oauth2/v2.0/token @scopes = {{CLIENT_ID}}/.default openid profile offline_access # ----------------------- # OAUTH refresh_token # ----------------------- ### # @name refresh POST https://{{oauth_token_host}} HTTP/1.1 Content-Type: application/x-www-form-urlencoded grant_type=refresh_token &client_id={{CLIENT_ID}} &client_secret={{CLIENT_SECRET}} &refresh_token={{REFRESH_TOKEN}} &scope={{scopes}} # ----------------------- # API (Variables) # ----------------------- ### @access_token = {{refresh.response.body.access_token}} @LEGAL_HOST = {{HOST}}/api/legal/v1 @tag = legal-tag-load # ----------------------- # API: Version # ----------------------- ### # @name info GET {{LEGAL_HOST}}/info Authorization: Bearer {{access_token}} Accept: application/json # ----------------------- # API: legal # ----------------------- ### # @name getTagProperties GET {{LEGAL_HOST}}/legaltags:properties Authorization: Bearer {{access_token}} Accept: application/json data-partition-id: {{DATA_PARTITION}} ### # @name getAllTag GET {{LEGAL_HOST}}/legaltags Authorization: Bearer {{access_token}} Accept: application/json data-partition-id: {{DATA_PARTITION}} ### # @name create_tag POST {{LEGAL_HOST}}/legaltags Authorization: Bearer {{access_token}} Content-Type: application/json data-partition-id: {{DATA_PARTITION}} { "name": "{{tag}}", "description": "This is a TNO Data load tag", "properties": { "countryOfOrigin": [ "US" ], "contractId": "A1234", "expirationDate": "2028-12-31", "originator": "MyCompany", "dataType": "Transferred Data", "securityClassification": "Public", "personalData": "No Personal Data", "exportClassification": "EAR99" } } ### # @name getTag GET {{LEGAL_HOST}}/legaltags/{{DATA_PARTITION}}-{{tag}} Authorization: Bearer {{access_token}} Accept: application/json data-partition-id: {{DATA_PARTITION}} ### # @name updateTag PUT {{LEGAL_HOST}}/legaltags Authorization: Bearer {{access_token}} Content-Type: application/json data-partition-id: {{DATA_PARTITION}} { "name": "{{DATA_PARTITION}}-{{tag}}", "contractId": "A1234", "description": "Updated: This is a test tag from Rest Scripts", "expirationDate": "2035-12-25" } ### # @name deleteTag DELETE {{LEGAL_HOST}}/legaltags/{{DATA_PARTITION}}-{{tag}} Authorization: Bearer {{access_token}} Accept: application/json data-partition-id: {{DATA_PARTITION}}