Hi Sam,
It might be easier to try using curl to test this endpoint as it lets you be very specific with the request.
I managed to get it working using the following steps:
Create the metadata file called metadata.json
with the following content:
{
"author":["Tom", "Ben"],
"id":["123"]
}
Create the content html called content.html
with the following content:
<html>
<head></head>
<body>blah blah</body>
</html>
Generate the authentication token using the methods found on https://community.funnelback.com/knowledge-base/system-adminstration/api-authentication-methods
Craft the curl request as shown on the API page:
curl -X POST 'https://<SERVER>:<PORT>/push-api/v2/collections/gt-test-push/documents/content-and-metadata?key=http://foo.com/' -H 'Content-Type: multipart/form-data' -H 'Authorization: Basic <security token>=' -F "metadata=@metadata.json; type=application/json " -F "content=@content.html; type=text/html" -i
The response will be something similar to the below:
HTTP/1.1 200 OK
Date: Thu, 07 Mar 2019 10:56:46 GMT
X-Security-Token: <removed for security>
Set-Cookie: remember-me=<removed for security>;Path=/;Expires=Mon, 11-Mar-2019 10:56:46 GMT;Max-Age=345600;Secure;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: DENY
Content-Length: 53
Server: Jetty(9.4.z-SNAPSHOT)
{"message":"Added!","storedKeys":["http://foo.com/"]}
Please note that metadata specified in this way still needs to be mapped using Funnelback metadata mappings. e.g. In my case, author
and id
metadata fields needs mapped to metadata classes before I am able to use them in Funnelback for things like faceting.
Hope this helps.
Thanks,
~Gioan