diff --git a/6.1curlcommands.md b/6.1curlcommands.md index 11eb4d2..80d0a69 100644 --- a/6.1curlcommands.md +++ b/6.1curlcommands.md @@ -255,6 +255,47 @@ curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin ] }' ``` +```bash +curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ +'{ + "displayName":"Play Audio", + "description":"Listen to an audio file.", + "toolName":"audioPreviewer", + "scope":"file", + "types":["preview"], + "toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.4/AudioPreview.html", + "toolParameters": { + "queryParameters":[ + {"fileid":"{fileId}"}, + {"siteUrl":"{siteUrl}"}, + {"datasetid":"{datasetId}"}, + {"datasetversion":"{datasetVersion}"}, + {"locale":"{localeCode}"} + ] + }, + "contentType":"audio/mp4", + "allowedApiCalls": [ + { + "name": "retrieveFileContents", + "httpMethod": "GET", + "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=true", + "timeOut": 3600 + }, + { + "name": "downloadFile", + "httpMethod": "GET", + "urlTemplate": "/api/v1/access/datafile/{fileId}?gbrecs=false", + "timeOut": 3600 + }, + { + "name": "getDatasetVersionMetadata", + "httpMethod": "GET", + "urlTemplate": "/api/v1/datasets/{datasetId}/versions/{datasetVersion}", + "timeOut": 3600 + } + ] +}' +``` ```bash curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \