gdcc / dvwebloader

A web tool for uploading folders of files to a Dataverse dataset
Apache License 2.0
1 stars 6 forks source link

ERROR","message":"Unknown reserved word #5

Closed jmjamison closed 1 year ago

jmjamison commented 1 year ago

error: {"status":"ERROR","message":"Unknown reserved word: https://dataverse.ucla.edu"} I'm trying to compare this to the examples in https://guides.dataverse.org/en/latest/api/external-tools.html. The reserved words look correct and I get a similar error if I change the order - pid or key first.

curl -vv -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \

'{ "displayName": "Dataverse WebLoader", "description": "Upload all the files in a local directory!", "toolName": "dvwebloader", "scope": "dataset", "contentType":"text/plain", "types": [ "explore" ], "toolUrl": "https://gdcc.github.io/dvwebloader/src/dvwebloader.html", "toolParameters": { "queryParameters": [ { "siteUrl": "https://dataverse.ucla.edu" }, { "datasetPid": "doi:10.25346/S6/EZYHS4" }, { "key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } ] } }'

  • About to connect() to localhost port 8080 (#0)

  • Trying ::1...

  • Connected to localhost (::1) port 8080 (#0) POST /api/admin/externalTools HTTP/1.1 User-Agent: curl/7.29.0 Host: localhost:8080 Accept: / Content-type: application/json Content-Length: 548

  • upload completely sent off: 548 out of 548 bytes < HTTP/1.1 400 Bad Request < Server: Payara Server 5.2021.6 #badassfish < X-Powered-By: Servlet/4.0 JSP/2.3 (Payara Server 5.2021.6 #badassfish Java/Red Hat, Inc./11) < Content-Type: application/json;charset=UTF-8 < Connection: close < Content-Length: 80 < X-Frame-Options: SAMEORIGIN <

  • Closing connection 0 {"status":"ERROR","message":"Unknown reserved word: https://dataverse.ucla.edu"}[ec2-user@ip-172-31-17-169 ~]$

qqmyers commented 1 year ago

Jamie, you don't need to/shouldn't change the example to put in the specific values you want. The tool registration uses the text like {siteUrl} to indicate that Dataverse itself should put those values in when you launch the tool. So - just cut/paste/run the curl example exactly as it is and that will reigster the tool. When you run it, you should see values like the ones you're trying to add above in the browser URL bar when you actually run the tool.

jmjamison commented 1 year ago

Thank you for clarifying. Installed and uploading a folder now. I have a user you will have made very happy with this tool.