Was this page helpful?

POST:site/import

    Overview

     



    public. Generates import information

    Uri Parameters

    None

    Query Parameters
    Name Type Description
    forceoverwrite bool? Force overwrite of destination, even if import content is older.
    relto int? Page used for path normalization (default: home page)
    reltopath string? Page used for path normalization. Ignored if relto parameter is defined.
    Return Codes
    Name Value Description
    BadRequest 400 Invalid input parameter or request body
    Ok 200 The request completed successfully

    Message Format

    Input:

    <manifest version="{version}">
        <page dataid="{text1}">
          <title>{text}</title>
          <path>{page path using // to indicate relativity to base export page}</path>
          <language>{text}</language>
          <contents type="{mimetype}"/>
        </page>
        <tags dataid="{text2}">
          <path>{page path using // to indicate relativity to base export page}</path>    
        </tags>
        <property dataid="{text3}">
          <name>{text}</name>
          <path>{page path using // to indicate relativity to base export page}</path>
          <contents type="{mimetype}"/>
        </property>
        <file dataid="{text4}">
          <filename>{text}</filename>
          <path>{page path using // to indicate relativity to base export page}</path>
          <description>{text}</description>
          <contents type="{mimetype}" />
        </file>
        <property dataid="{text5}">
          <name>{text}</name>
          <filename>{text}</filename>
          <path>{page path using // to indicate relativity to base export page}</path>
          <contents type="{mimetype}"/>
        </property>
        ...
      </manifest>

    Output:

    <requests>
      <request method="POST" href="http://host/@api/deki/pages/{path}/contents?reltopath={path}&edittime={timestamp}&lang={lang}&title={text}" dataid="{text1}" type="{mimetype}" >
        <header name="{text}" value="{text}" />
          ...
      </request>
      <request method="PUT" href="http://host/@api/deki/pages/{path}/tags" dataid="{text2}" type="{mimetype}" >
        <header name="{text}" value="{text}" />
          ...
      </request>
      <request method="PUT" href="http://host/@api/deki/pages/{path}/properties" dataid="{text3}" type="{mimetype}" >
        <header name="{text}" value="{text}" />
          ...
      </request>
      <request method="PUT" href="http://host/@api/deki/pages/{path}/files/{filename}" dataid="{text4}" type="{mimetype}" >
        <header name="{text}" value="{text}" />
          ...
      </request>
      <request method="PUT" href="http://host/@api/deki/pages/{path}/files/{filename}/properties" dataid="{text5}" type="{mimetype}" >
        <header name="{text}" value="{text}" />
          ...
      </request>
      <request method="POST" href="http://host/@api/deki/pages/{id}/security" type="text/xml">
        <body type="xml">
          {xml body to post}
        </body>
      </request>
      <warning reason="{text}" status="401|404">
        <page dataid="{text6}">
          <title>{text}</title>
          <path>{page path using // to indicate relativity to base export page}</path>
          <language>{text}</language>
          <contents type="{mimetype}"/>
        </page>
      </warning>
      ...
    </requests>

    Implementation Notes

    The import manifest document expected as input is the same as the manifest section from the export response. It can also be manually generated against your own content.

    The requests document provides instructions for what HTTP requests must be executed to import the content from your import manifest. If a request has a dataid attribute, the data correlated to that dataid from your manifest is to be used as the request body. Request blocks with a body block will never have a dataid attribute and expect the contents of the body block to be used as the request body instead.

    There currently exist two tools that will automate the import process for you:

    1. Desktop Connection
    2. mindtouch.import.exe

    Code Samples

    C# Samples

     

    Curl Samples

     

    PHP Samples

     

    Other Code Samples

     

    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by