Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Codeblock
languagejs
[
  {
    "Name": "usageArea",
    "Values": [
      "Marketing",
	  "TechPubs"
    ]
  },
{
    "Name": "CMS_Id",
    "Values": [
      "Id001"
    ]
  }
]

To store the attributes along with the XML file you need to add a new request parameter to the code shown above (StoreXML).

Codeblock
languagec#
public void StoreXml(string host, string filename, string culture, string token){
 
    var client = new RestClient(host + "/Congree/api/AuthoringMemory/v1/ImportXml?lang=" + culture);
    var request = new RestRequest(Method.POST);
    request.AddHeader("Content-Type", "multipart/form-data");
    request.AddHeader("Authorization", "Bearer " + token);
     
    request.AddHeader("Content-Type", "multipart/form-data");
    request.AlwaysMultipartFormData = true;
    request.AddFile("file", filename,  ParameterType.RequestBody);
	request.AddParameter("attributes", "[ { "Name": "usageArea", "Values": ["Marketing","TechPubs"]},{ "Name": "CMS_Id","Values": ["Id001"]}]");
    IRestResponse response = client.Execute(request);
 
}


Searching for sentences in the Authoring Memory

...