Skip to main content

 Services

Web services from /about to /webhooks

add uri fragment

/members/{member}/groups/{group}/uris/{uri}/fragments [POST]

Description

Create a new fragment at specified location in a document.

Parameters

NameDescriptionRequiredTypeDefault
contentContent of edityesstring
afterfragmentID of the fragment to insert the fragment after (required if no section or beforefragment, overrides section and beforefragment)maybestring
beforefragmentID of the fragment to insert the fragment before (required if no section or afterfragment, overrides section)maybestring
sectionID of the section to append the fragment to, after other fragments (required if no beforefragment or afterfragment)maybestring
draftA flag to save edit as a draftnobooleanfalse
fragment
The fragment ID to use if not generatednofragment-id
fragmentprefixPrefix in front of the generated fragment IDnofragment-id
htmlFlag to specify if content is HTMLnobooleanfalse
labelsComma-separated list of edit labels valuesnostring
markdownA flag to specify if content is markdown (overrides html parameter)nobooleanfalse
noteContent for edit notes (if exists, creates a note)nostring
note-labelsComma-separated list of label values for the note (if exists, creates a note)nostring
note-titleA title for the edit notenostringEdit Note
transcludeA flag to resolve transclusions when outputting resultnobooleantrue

Permission

This service requires contributor or higher.

Response

When successful, the new fragment is returned as a <document-fragment> wrapped in a <fragment-creation> element.

Example:


<fragment-creation notification-email-failed="true">
  <document-fragment [draft="true"]>
    <locator id="325"
             fragment="example"
             editid="6340"
             modified="2015-03-24T13:21:57">
      <notes>
        <note id="6342"
              modified="2015-03-24T13:21:57"
              title="Typography">
          <content>Fixed typographical error.</content>
        </note>
      </notes>
    </locator>
    <fragment id="example">
      <para>This is the fragment content</para>
    </fragment>
  </document-fragment>
</fragment-creation>

Error Handling

CodeCause / Description
0x120BError processing XRefs
0x120CError creating fragment
0x120DContent validation error
0x122CThe fragment already exists
0x122DThe fragment is invalid
0x6302Failed to create new comment
Created on , last edited on