Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

We You can use the following steps to upload text through rest interface to Quadrigaupload texts to Quadriga projects using Quadriga's API.

Step-by-step guide

The REST endpoint has been provided by Quadriga atto upload texts to Quadriga is provided at: http://your.quadriga.instance/quadriga/rest/project/{projectId}/workspace/{workspaceId}/text

Typically when we deploy Quadriga on local machine, the endpoint would be

http://localhost:8080/quadriga/rest/project/{projectId}/workspace/{workspaceId}/text

  1. Get the relevant "projectId" and "workspaceId" for Make a POST request to the endpoint.
  2. You need the ID of the project and the ID of the workspace to which you want to upload the text.a text. This method will not automatically create projects or workspaces if they don't exist. You also need to provide the internal Quadriga ID of project and workspace. 
  3. Insert the "projectId" and "workspaceId" in the placeholders in the above specified url. Go to "pom.xml" of Quadriga and search for the tag "textfiles.location". Make sure that appropriate local path of the directory(which will contain the uploaded text) is given as value for that tag.For example: http://your.quadriga.instance/quadriga/rest/project/PROJ76YUI/workspace/WS34RTrt/text
  4. You will be uploading text by sending XML in the body as payload of your request. It must contain the following tags:
    1. <text>                 -
    It contains the text which we are uploading
    1. The proberly escaped text to be uploaded. 
    2. <handle>            -
    It contains the uri from where
    1. The URI of the original (where the text is taken).
    2. <file_name>       -
    It contains the name of the text file which are uploading
    1. A filename for the uploaded text.
    2. <accessibility>   -
    It contains the information about the visibility
    1. Visibility of the file.

                               
    1.  It's value can only be either "PUBLIC" (anyone can see a text) or "PRIVATE" (only project members can see a text).
      See the provided sample input file ("InputText.xml")
    is provided
    1. for reference.
  5. When If the upload is successful, xml is sent as response.
    sample an XML response is sent that contains a URI that points to the uploaded text. See the sample output file ("TextUploadResponse.xml") is sent as responsefor reference.

 

Files:

Sample Input XML: InputText.xml

Sample Output XML: TextUploadResponse.xml

 

...

Filter by label (Content by label)
showLabelsfalse
max5
spacesQUAD
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "QUAD"
labelskb-how-to-article

...

hiddentrue

...