add uri fragment
/members/{member}/groups/{group}/uris/{uri}/fragments [POST]
API Support | Available since | Last updated | Output |
---|---|---|---|
5.0100 | 6.0000 | xml |
Description
Create a new fragment at specified location in a document.
Parameters
Name | Description | Required | Type | Default |
---|---|---|---|---|
content | Content of edit | yes | string | |
afterfragment | ID of the fragment to insert the fragment after (required if no section or beforefragment, overrides section and beforefragment) | maybe | string | |
beforefragment | ID of the fragment to insert the fragment before (required if no section or afterfragment, overrides section) | maybe | string | |
section | ID of the section to append the fragment to, after other fragments (required if no beforefragment or afterfragment) | maybe | string | |
draft | A flag to save edit as a draft | no | boolean | false |
fragment | The fragment ID to use if not generated | no | fragment-id | |
fragmentprefix | Prefix in front of the generated fragment ID | no | fragment-id | |
html | Flag to specify if content is HTML | no | boolean | false |
labels | Comma-separated list of edit labels values | no | string | |
markdown | A flag to specify if content is markdown (overrides html parameter) | no | boolean | false |
note | Content for edit notes (if exists, creates a note) | no | string | |
note-labels | Comma-separated list of label values for the note (if exists, creates a note) | no | string | |
note-title | A title for the edit note | no | string | Edit Note |
transclude | A flag to resolve transclusions when outputting result | no | boolean | true |
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
Code | Cause / Description |
---|---|
0x120B | Error processing XRefs |
0x120C | Error creating fragment |
0x120D | Content validation error |
0x122C | The fragment already exists |
0x122D | The fragment is invalid |
0x6302 | Failed to create new comment |