Watson Discovery

 View Only
  • 1.  API Discovery - Add a document

    Posted Wed December 16, 2020 11:05 AM
    Hi Community,

    I am trying to use the API Discovery. All my environment, collection and query have been directly configured thru Watson Discovery console and work fine. All my Rest requests on environment, collection, etc. are working well also.

    My question is about "Add a document". In the documentation, the syntax of the Rest request is the following.
    curl -X POST -u "apikey":"{apikey}" -F file=@sample1.html "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents?version=2019-04-30"

    If the document that I want to upload in Watson Discovery is for example on the HDD of my PC,  what I need to specify instead of -F file=@sample1.html

    I cannot find the right syntax.

    Regards, Philippe

    ------------------------------
    philippe mouret
    ------------------------------

    #WatsonDiscovery


  • 2.  RE: API Discovery - Add a document

    Posted Wed December 16, 2020 12:00 PM
    Hi Philippe,

    instead of "@sample1.html" try something like "@/C:/Users/Fredrik/Downloads/sample.html" depending on where it is located on your PC.

    Thanks,
    Fredrik


    ------------------------------
    FREDRIK TUNVALL
    ------------------------------



  • 3.  RE: API Discovery - Add a document

    Posted Thu December 17, 2020 04:33 AM

    Thank you very much. Very helpfull. That woks now.

    Regards, Philippe



    ------------------------------
    philippe mouret
    ------------------------------