fabric-samples/demo.http
sapthasurendran c3a34ef559 apikey auth for Org1
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>

removed auth check from live,ready apis..

code format

http file changes for apikey

comments for getting api key

readme update for apikey usage

replaced -H with --header

apikey config made mandatory

fix linting

Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-14 14:31:13 +00:00

74 lines
1.3 KiB
HTTP

// Demo file for use with REST Client for Visual Studio Code
// See https://github.com/Huachao/vscode-restclient
@hostname = localhost
@port = 3000
@baseUrl = http://{{hostname}}:{{port}}/api
//Get the apikey from .env file
@api-key= Api-Key 295069C9-ABF5-4D2A-A020-2FF9F4E8DF07
### Get all assets
GET {{baseUrl}}/assets HTTP/1.1
api-key: {{api-key}}
### Check if asset exists
OPTIONS {{baseUrl}}/assets/asset7 HTTP/1.1
api-key: {{api-key}}
### Create asset
POST {{baseUrl}}/assets HTTP/1.1
content-type: application/json
api-key: {{api-key}}
{
"id": "asset7",
"color": "red",
"size": 42,
"owner": "Jean",
"appraisedValue": 101
}
### Read transaction status
GET {{baseUrl}}/transactions/__transaction_id__ HTTP/1.1
api-key: {{api-key}}
### Read asset
GET {{baseUrl}}/assets/asset7 HTTP/1.1
api-key: {{api-key}}
### Update asset
PUT {{baseUrl}}/assets/asset7 HTTP/1.1
content-type: application/json
api-key: {{api-key}}
{
"id": "asset7",
"color": "red",
"size": 11,
"owner": "Jean",
"appraisedValue": 101
}
### Transfer asset
PATCH {{baseUrl}}/assets/asset7 HTTP/1.1
content-type: application/json
api-key: {{api-key}}
[
{
"op": "replace",
"path": "/owner",
"value": "Ashleigh"
}
]
### Delete asset
DELETE {{baseUrl}}/assets/asset7 HTTP/1.1
api-key: {{api-key}}