Aurora API: Snippets

Snippet

Using this controller you can add, edit, delete and retrieve all Snippets.

Add

Deferred: No

Example Request:

<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
  <Header>
    <AuthToken>...</AuthToken>
  </Header>
  <Requests>
    <Request>
      <Snippet>
        <Add>
          <DisplaySnippet>1</DisplaySnippet>
          <SnippetTitle>My snippet</SnippetTitle>
          <SnippetType>Text/HTML</SnippetType>
          <SnippetContent>This is the content.</SnippetContent>
          <SnippetDescription></SnippetDescription>
          <UseWYSIWYG>1</UseWYSIWYG>
          <UseInMerchandiser>1</UseInMerchandiser>
          <EnableSmarty>1</EnableSmarty>
        </Add>
      </Snippet>
    </Request>
  </Requests>
</AuroraRequestEnvelope>

Example Response:

<?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
  <Header>
    <Summary>
      <Ack>OK</Ack>
      <RequestsProcessed>1</RequestsProcessed>
      <RequestsSucceeded>1</RequestsSucceeded>
      <RequestErrors>0</RequestErrors>
    </Summary>
  </Header>
  <Responses>
    <Response>
      <RequestID>1</RequestID>
      <Ack>OK</Ack>
      <Data>
        <SnippetID>30</SnippetID>
      </Data>
    </Response>
  </Responses>
</AuroraResponseEnvelope>

Request Fields

FieldValuesAPI VersionDescriptionRequired
DisplaySnippet[0\1]1.4+Sets where a snippet should be made available to the Front-end.No
SnippetTitleString1.4+The title used for the snippet.Yes
SnippetType["JSON", "Text/HTML"]1.4+The type of the snippet. See the Snippets article for more information on this behaviour.No
SnippetContentString1.4+The actual snippet content.Yes
SnippetDescriptionString1.4+A short description of the snippet for internal Admin reference only.No
UseWYSIWYG[0\1]1.4+Whether or not the Snippet should use the WYSIWYG Editor.No, may only include one of UseWYSIWYG or UsePageBuilder
UsePageBuilder[0\1]1.4+Whether or not the Snippet should use the Page Builder (Beta).No, may only include one of UseWYSIWYG or UsePageBuilder
UseInMerchandiser[0\1]1.4+Whether or not the Snippet should be made available to Aurora's merchandising features.Only if 'Token' is provided
EnableSmarty[0\1]1.4+Whether or not the Snippet should be processed using Smarty before display to the Front-end.No

Update

Deferred: No

The 'Update' call is almost identical to the 'Add' call with the only real difference being that most of the fields are now optional. While adding a new item requires that you provide all necessary information at once, when using the 'Update' method, you can just provide the information you wish to change and leave out all of the rest (excluding the relevant ID fields of course which are use to identify the records to be updated).

Example Request:

 <?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
  <Header>
    <AuthToken>...</AuthToken>
  </Header>
  <Requests>
    <Request>
      <Snippet>
        <Update>
          <SnippetID>30</SnippetID>
          <UseInMerchandiser>0</UseInMerchandiser>
        </Update>
      </Snippet>
    </Request>
  </Requests>
</AuroraRequestEnvelope>

Example Response:

 <?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
  <Header>
    <Summary>
      <Ack>OK</Ack>
      <RequestsProcessed>1</RequestsProcessed>
      <RequestsSucceeded>1</RequestsSucceeded>
      <RequestErrors>0</RequestErrors>
    </Summary>
  </Header>
  <Responses>
    <Response>
      <RequestID>1</RequestID>
      <Ack>OK</Ack>
      <Data>
        <SnippetID>30</SnippetID>
      </Data>
    </Response>
  </Responses>
</AuroraResponseEnvelope>

Delete

Deferred: No

Example Request:

<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
  <Header>
    <AuthToken>...</AuthToken>
  </Header>
  <Requests>
    <Request>
      <Snippet>
        <Delete>
          <SnippetIDs>
            <SnippetID>30</SnippetID>
          </SnippetIDs>
        </Delete>
      </Snippet>
    </Request>
  </Requests>
</AuroraRequestEnvelope> 

Example Response:

 <?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
  <Header>
    <Summary>
      <Ack>OK</Ack>
      <RequestsProcessed>1</RequestsProcessed>
      <RequestsSucceeded>1</RequestsSucceeded>
      <RequestErrors>0</RequestErrors>
    </Summary>
  </Header>
  <Responses>
    <Response>
      <RequestID>1</RequestID>
      <Ack>OK</Ack>
      <Data/>
    </Response>
  </Responses>
</AuroraResponseEnvelope>

Request Fields

FieldValuesAPI VersionDescriptionRequired
SnippetIDsContainer1.4+No
SnippetIDs.SnippetIDInteger1.4+The ID of the Snippet to delete.Only if 'SnippetIDs' is provided

Get

Deferred: No

Records returned by this call are currently always ordered by the date they were created. This may change, so you should consider specifying the sort order of your results if this is going to affect your systems performance in the future.

The 'tracking' attribute can be used to denote whether or not tracking should be enabled, please see Request Tracking for more details.

Example Request:

 <?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope>
  <Header>
    <AuthToken>LF123456789ABCDEFG</AuthToken>
  </Header>
  <Requests>
    <Request>
      <Snippet>
        <Get>
          <Language>all</Language>
          <Paging>
            <Limit>2</Limit>
            <Page>1</Page>
          </Paging>
        </Get>
      </Snippet>
    </Request>
  </Requests>
</AuroraRequestEnvelope>

Example Response:

 <?xml version="1.0" encoding="utf-8"?>
<AuroraResponseEnvelope>
  <Header>
    <Summary>
      <Ack>OK</Ack>
      <RequestsProcessed>1</RequestsProcessed>
      <RequestsSucceeded>1</RequestsSucceeded>
      <RequestErrors>0</RequestErrors>
    </Summary>
  </Header>
  <Responses>
    <Response>
      <RequestID>1</RequestID>
      <Ack>OK</Ack>
      <Paging>
        <Token>45496d9c89cf17e18248959de3359af9610</Token>
      </Paging>
      <Data>
        <Snippet>
          <ContentID>2</ContentID>
          <DisplaySnippet>1</DisplaySnippet>
          <SnippetTitle language="en-gb"/>
          <SnippetTitle language="de"/>
          <SnippetContent language="en-gb">Secure payment information</SnippetContent>
          <SnippetContent language="de">Secure payment information</SnippetContent>
          <SnippetType>Text/HTML</SnippetType>
          <SnippetDescription language="en-gb"/>
          <SnippetDescription language="de"/>
          <UseWYSIWYG>0</UseWYSIWYG>
          <UsePageBuilder>1</UsePageBuilder>
          <UseInMerchandiser>0</UseInMerchandiser>
          <DateCreated>2010-09-01 16:50:02</DateCreated>
          <EnableSmarty>1</EnableSmarty>
        </Snippet>
        <Snippet>
          <ContentID>3</ContentID>
          <DisplaySnippet>1</DisplaySnippet>
          <SnippetTitle language="en-gb"/>
          <SnippetTitle language="de"/>
          <SnippetType>Text/HTML</SnippetType>
          <SnippetContent language="en-gb">Choose from standard, next day or Saturday delivery with guaranteed.....</SnippetContent>
          <SnippetContent language="de">Choose from standard, next day or Saturday delivery with guaranteed.....</SnippetContent>
          <SnippetDescription language="en-gb"/>
          <SnippetDescription language="de"/>
          <UseWYSIWYG>0</UseWYSIWYG>
          <UsePageBuilder>1</UsePageBuilder>
          <UseInMerchandiser>0</UseInMerchandiser>
          <DateCreated>2010-09-01 16:50:16</DateCreated>
          <EnableSmarty>0</EnableSmarty>
        </Snippet>
      </Data>
    </Response>
  </Responses>
</AuroraResponseEnvelope>

Request Fields

FieldValuesAPI VersionDescriptionRequired
SnippetIDsContainer1.4+No
SnippetIDs.SnippetIDInteger1.4+The ID to restrict the result to.Only if 'SnippetIDs' is provided
DetailLevelDetail Levels1.4+This allows the client to request varying volumes of data when receiving data back from the server.No
Language"all" or language ISO1.4+This allows the client to request specific or all languages to be returned. If not included in the request the default language will be returned.No
TrackingRequest Tracking1.4+If this is set to 'unsent' then any orders previously retrieved via the current API account while 'tracking' was active will be excluded from the results. This allows for unique order exports to be set-up easily to avoid duplicate orders being downloaded.No
LimitInteger > 01.4+The number of records to return.No
PagingContainer1.4+See PagingNo
Paging.TokenString1.4+This is the Token string issued from any previous Get call featuring paging. Providing this will have the API collect the data from the previously generated set of data, ensuring accurate and consistent dataset results for every page. You cannot change the request properties previously provided when using a Token, so these are ignored by the API.No
Paging.LimitInteger > 01.4+The number of results to return in the page being requested.No
Paging.PageInteger > 01.4+The page number to return the results for.Only if 'Token' is provided