-
Notifications
You must be signed in to change notification settings - Fork 7
Pushing JSON Files with the Coveo CLI
jpmarceau edited this page Jul 21, 2021
·
2 revisions
The Coveo CLI exposes various commands that allow you to push correctly formatted JSON documents to the Coveo Cloud Push API.
For a document to be considered valid by the Coveo Cloud Push API, it needs to minimally contain a title and a URI:
{
"title": "Batman",
"documentId": "https://themoviedb.org/movie/268"
}Where:
-
titleis a non empty string. -
documentIdis a non empty valid URI.
You can push secured content in the following format:
{
"documentId": "https://themoviedb.org/movie/268",
"title": "Batman",
"permissions": {
"allowAnonymous": false,
"allowedPermissions": [
{
"identity": "bob@anonymous.com",
"identityType": "USER",
"securityProvider": "Email Security Provider"
}
],
"deniedPermissions": [
{
"identity": "MarketingTeam",
"identityType": "GROUP",
"securityProvider": "My Security Provider"
}
]
}
}
Where the parameter structure is as follows:
-
permissionsis an object.-
allowAnonymousis a boolean. -
allowedPermissionsanddeniedPermissionsare arrays.-
identityis a non empty string. -
identityTypeis one of the following strings:'UNKNOWN' or 'USER' or 'GROUP' or 'VIRTUAL_GROUP'. -
securityProvideris a non empty string.
-
-
Some attributes are not mandatory, but recommended:
{
"documentId": "https://themoviedb.org/movie/268",
"title": "Batman",
"data": "Batman (1989) \n Based on the Character created by Bob Kane. \n EXT. CITYSCAPE - NIGHT \n Gotham City. The City of Tomorrow: stark angles, creeping shadows, dense, crowded, as if hell had erupted through the sidewalks. A dangling fat moon shines overhead. \n At the opposite corner of the roof, some fifteen yards away... at the end of a line, a STRANGE BLACK SILHOUETTE is dropping slowly, implacably, into frame...",
"clickableUri": "https://themoviedb.org/movie/268",
"date": "1989-06-13T12:00:00.000Z"
}-
datais a string containing the searchable text for this document (see Pushing Item Data). -
clickableUriis a string that can be used to set a URL that end users can use to reach the document. Can be omitted if thedocumentIdalready contains a valid clickable URL. -
dateis a string that can be used to set the date of the document. If omitted, the Push API uses the current date (see Automatically Included Standard Metadata).
Any other metadata that you would like to push can be set as key-value pairs in the JSON document:
{
"documentId": "https://themoviedb.org/movie/268",
"title": "Batman",
"poster": "https://www.themoviedb.org/t/p/w1280/tDexQyu6FWltcd0VhEDK7uib42f.jpg",
"tagline": "Have you ever danced with the devil in the pale moonlight?",
"summary": "The Dark Knight of Gotham City begins his war on crime with his first major enemy being the clownishly homicidal Joker, who has seized control of Gotham's underworld.",
"actors": ["Jack Nicholson", "Michael Keaton", "Kim Basinger"]
}A file can contain either one or multiple documents.
{
"documentId": "https://themoviedb.org/movie/268",
"title": "Batman"
}[
{
"documentId": "https://www.themoviedb.org/movie/268",
"title": "Batman",
},
{
"documentId": "https://www.themoviedb.org/movie/550",
"title": "Fight Club",
}
]