Search code examples
jsonretrieve-and-rank

Watson API - Retrieve and Rank - Error uploading JSON


I'm following the tutorial at Retrieve and Rank - Get Started, and I'm at the following step:

Issue the following command to upload the cranfield_data.json data to the example_collection collection. Replace {username}, {password}, {solr_cluster_id}, and {/path_to_file} with your information:

$ curl -X POST -H "Content-Type: application/json" -u "{username}":"{password}" "https://gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/{solr_cluster_id}/solr/example_collection/update" --data-binary @{/path_to_file}/cranfield_data.json

I'm lobbing the request with the correct username and password, and correct cluster_id and path to the json, but I get the following error:

$ curl -X POST -H "Content-Type: application/json" -u "username":"password" "https://gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/cluster_id/solr/example_collection/update" --data-binary @forum_data/parsed_answers.json

Error: WRRCSH006: Error forwarding request [/solr/example_collection/update] for Solr cluster [sc5b47c5e3_bab3_4aff_a818_f0d786d6dece].

Solution

  • Turns out there were characters in the JSON causing it be malformed.