Create or update message bundles

post/contents/{namespace}

Retrieves multiple properties files in the http request and the API creates new message bundles or updates the existing message bundles. The properties files can be archived in a ZIP file. This API accepts the ZIP file. In the http request, the properties files or a ZIP file are written in the MIME multipart/form-data format RFC7578.

The properties file names have to follow the naming convention which is described in the section "import/export the message bundles as properties files".

This API returns a set of returned statuses. Its items that correspond to the properties files.

Using the curl command, a ZIP file can be posted.
Here is an example.

HOST=[Your cluster address]
TOKEN=[Access token]
curl -X POST  \
-H "authorization:bearer $TOKEN" \
-H "Accept: application/vnd.sas.collection+json" \
-F "file=@archive.zip" \
https://$HOST/localization/contents/entertainment
The example uploads the archive.zip file that contains some properties files for the namespace "entertainment" and gets the results of the POST operation from the endpoint in the standard output.

Request Samples

Response Samples

1{
2 "accept": "string",
3 "count": 0,
4 "items": [
5 {
6 "details": [
7 "string"
8 ],
9 "errorCode": 0,
10 "errors": [
11 {}
12 ],
13 "httpStatusCode": 0,
14 "id": "string",
15 "links": [
16 {
17 "href": "string",
18 "itemType": "string",
19 "method": "string",
20 "rel": "string",
21 "responseItemType": "string",
22 "responseType": "string",
23 "title": "string",
24 "type": "string",
25 "uri": "string"
26 }
27 ],
28 "message": "string",
29 "remediation": "string",
30 "version": 0
31 }
32 ],
33 "limit": 0,
34 "links": [
35 {
36 "href": "string",
37 "itemType": "string",
38 "method": "string",
39 "rel": "string",
40 "responseItemType": "string",
41 "responseType": "string",
42 "title": "string",
43 "type": "string",
44 "uri": "string"
45 }
46 ],
47 "name": "string",
48 "start": 0,
49 "version": 1
50}

Path Parameters

namespace
string
true

The namespace of the message bundle.

Header Parameters

Accept
string
true

"application/json" or "application/vnd.sas.collection+json" are accepted.

Accept-Item
string
true

"application/json" or "application/vnd.sas.error+json" are accepted.

Content-Type
string
true

The Content-Type should be 'multipart/form-data' and the MIME boundary needs to be specified with the 'boundary='. Here''s an example. 'Content-Type: multipart/form-data; boundary=aBoundaryString'

Request Body

The properties files must be written in UTF-8.

The http request body can contain multiple properties files or a ZIP file in the MIME multipart/form-data format RFC7578. The Content-Type must be `multipart/form-data` followed by the `boundary=` MIME parameter to specify the boundary of the MIME parts. Here is an example.

Content-Type: multipart/form-data; boundary=aBoundaryString
Each MIME part needs to have the MIME header `Content-Disposition`, which has parameters name="file" and filename=.
Here are examples.
Content-Disposition: form-data; name="file"; filename="myNamespace_default.properties"
Content-Disposition: form-data; name="file"; filename="myProperties.zip"

Each properties file is assumed to put in each MIME body. The content of each properties file can be encoded in the quoted-printable or base64.
If the content is encoded in quoted-printable or base64, the MIME header "Content-Transfer-Encoding" needs to be specified to indicate the encoding.

If a ZIP file is included in the MIME body, the MIME header "Content-Type" must indicate "application/zip". Also, the content of the ZIP file should be encoded in base64. The MIME header "Content-Transfer-Encoding" needs to be specified to indicate base64 as below.

Content-Type: application/zip
Content-Transfer-Encoding: base64

Responses

StatusMeaningDescription
200OK

The request succeeded.

Schema
400Bad Request

The request was invalid.

Schema