0

I am exploring GeoNetwork to get if it is suitable for my purpose.

I need to use a script to upload several metadata with a file JSON associated. Is there any chance to use CSW / API to upload the files to the filestore available in the GUI (https://geonetwork-opensource.org/manuals/trunk/en/user-guide/associating-resources/using-filestore.html) ?

2
  • When you say with a JSON file associated, what do you mean? Do you mean the metadata to be uploaded is JSON, or do you mean that the data being described by the metadata is JSON? or something else, sorry it isn't clear.
    – nmtoken
    Commented May 15, 2020 at 15:49
  • I mean the data being described by the metadata is JSON Commented May 16, 2020 at 17:31

1 Answer 1

1

You'd need two calls, one to the CSW-T service to create the metadata record and other to store the JSON file in the filestore using the GeoNetwork API: POST /{portal}/api/0.1/records/{metadataUuid}/attachments

You can check the parameters here https://vanilla.geocat.net/geonetwork/doc/api/index.html#/records/putResourceFromFile

3
  • Thank you, didnt notice that API! Commented May 18, 2020 at 7:21
  • EDIT: I tried the API directly from Swagger and through Postman. In both the cases, I faced with Error 403 Forbidden. I used my user and pwd on Swagger, I used my user and pwd as basic auth on Postman. How can I authenticate this API? Commented May 19, 2020 at 8:41
  • That's probably caused because GN is not receiving the right XSRF token. Check the API guide at geonetwork-opensource.org/manuals/trunk/en/api/…
    – juanluisrp
    Commented May 19, 2020 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.