Jump to content

Help:Section/Editing sections of included templates

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 184.103.50.131 (talk) at 02:23, 15 February 2023. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Editing sections of included templates

This section appears in Help:Section.

The editing facilities can also be applied to a section of an included template. This section, Help:Editing sections of included templates, is an example.

For the purpose of section editing the extent of a section is governed by the headers in the calling page itself. It may consist of a part before the template tag, the template tag, and a part after the template tag, even if the template has sections.

It tends to be confusing if the extent of sections according to the system is different from what the rendered page suggests. To avoid this:

  • if a template has headers, do not put any text before the first header
  • in the calling page, start a new section after a template that itself has sections

It may be convenient, where suitable, to start a template with a section header, even if normally the contents of the template would not need a division into sections, and thus the template is only one section. The edit facilities for editing sections can then be used for editing the template from a page that includes it, without specially putting an edit link. This template is an example, it does not need a division into sections, but has a header at the top.

One downside with this solution is that you can't change the section level in the page that includes the template. This means that the section level you use in the template will be the same that is displayed on all your pages where you include the template, despite the fact that this might conflict with your intended hierarchy on the different pages.

Note that a parameter value appearing in a template, for example "{{{1}}}", is, if we want to preserve the parameter, not edited by editing the template but by editing the template call, even though the rendered page and its edit links do not automatically show that. Some explanatory text and/or an extra edit link can be useful. In this case, to edit "{{{1}}}" we have to edit the template tag on the page calling the template. If we use section editing the relevant section edit link is that at the header appearing before the header in the template itself.

Xero Developer Home Ways to Build Docs Community

Sign up Log in

Feed Connections Overview URLs https://api.xero.com/bankfeeds.xro/1.0/FeedConnections https://api.xero.com/bankfeeds.xro/1.0/FeedConnections/{FeedConnectionId} https://api.xero.com/bankfeeds.xro/1.0/FeedConnections/DeleteRequests Supported Methods GET, POST Description Feed Connections enable bank feeds by providing the link between financial institute transaction information and Xero’s representation of bank and credit card accounts (referred to as Xero Bank Accounts).

This endpoint allows the creation and termination of Feed Connections to Xero Bank Accounts. Xero Bank Accounts will be created if no matching Bank Account exists for the Xero Organisation. Terminating a Feed Connection will discontinue the bank feed, but won’t otherwise affect any customer data within the Xero Business product. User Role GET and POST require the Xero Adviser or Standard User role Any calls returning multiple records (GETs) will provide responses conforming to the following pagination and items collection format in the body

{

 "pagination": {
   "page": 1,
   "pageSize": 20,
   "pageCount": 1,
   "itemCount": 2
 },
 "items": [
   {
       // item 1 properties
   },
   {
       // item 2 properties
   }
 ]

}

copy code Get Feed Connection By ID GET https://api.xero.com/bankfeeds.xro/1.0/FeedConnections/{FeedConnectionID}

Retrieve a single Feed Connection by ID. Also returns the identifier of the Xero account that is connected.

Example response for GET Feed Connection by ID - 200 OK Response

GET https://api.xero.com/bankfeeds.xro/1.0/FeedConnections/50d3cf8d-95dc-4466-8dc0-47e6d1197e28

copy code {

 "id": "50d3cf8d-95dc-4466-8dc0-47e6d1197e28",
 "accountToken": "10000123",
 "accountType": "BANK",
 "accountNumber": "3809087654321500",
 "accountName": "Joe's Savings Account",
 "accountId": "079a88ea-276d-41fb-a1f1-366ef3e22921",
 "currency": "AUD"

}

copy code Get Feed Connections GET https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1&pageSize=20

Retrieve all Feed Connections. Also returns the identifier of the Xero account that is connected.

Optional Parameters Page Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example: https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the first set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. PageSize Page size which specifies how many records per page will be returned (default 10). Example: https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100. Example response for GET Feed Connections - 200 OK Response

GET `https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1&pageSize=20`

copy code {

 "pagination": {
   "page": 1,
   "pageSize": 20,
   "pageCount": 1,
   "itemCount": 2
 },
 "items": [
   {
     "id": "50d3cf8d-95dc-4466-8dc0-47e6d1197e28",
     "accountToken": "10000123",
     "accountType": "BANK",
     "accountNumber": "3809087654321500",
     "accountName": "Joe's Savings Account",
     "accountId": "079a88ea-276d-41fb-a1f1-366ef3e22921",
     "currency": "AUD"
   },
   {
     "id": "cab0d76e-1325-4d81-b5f8-5a8fadecbe87",
     "accountToken": "10000124",
     "accountType": "CREDITCARD",
     "accountNumber": "1234",
     "accountName": "Sam's Credit Card",
     "accountId": "5d0c30ca-57e6-4028-a1c3-a1ca24f5ed18",
     "currency": "AUD"
   }
 ]

}

copy code Create Feed Connections POST https://api.xero.com/bankfeeds.xro/1.0/FeedConnections

Upon receipt of the request, the Bank Feeds API will perform real time validation of the request, but will defer creation of the Feed Connections to expedite response times. Successful requests will receive a HTTP 202 Accepted status response indicating successful receipt of the collection of Items.

Elements for Feed Connection The following elements are required to add a new Feed Connection. AccountNumber OR AccountId must be specified. AccountId should be used when a customer has specified a particular account already setup in Xero they want to connect the bank feed to. Otherwise AccountNumber should be used. If both are included in the request, AccountID will be used.

AccountToken String(50) unicode This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. AccountId UUID Xero identifier for a bank account in Xero. This element is required only if AccountNumber is not specified. AccountNumber String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD. Only the last 4 digits of Credit Card must be supplied. The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. This element is required only if AccountId is not specified. AccountType Enum High level bank account type: BANK or CREDITCARD BANK encompasses all bank account types other than credit cards. AccountName String(30) unicode The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. Currency String(3) ISO-4217 currency code, e.g. USD, AUD. Country String(2) ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. Success Response An Accepted response indicates that the request passed validation and that the Feed Connections will be processed out of band. The response body includes an Items collection, each item is identified by its AccountToken and will have a Status of PENDING or REJECTED. Those Items with a status of PENDING meet all validation required and will be processed, those with a status of REJECTED have an Error item indicating the action that should be taken prior to resubmitting.

If all items have a REJECTED status, the Http Status Code of the response will be 400 Bad Request, rather than 202.

If required, progress of processing the individual Feed Connections may be monitored by polling GET on the FeedConnections resource.

Example of a create Feed Connections request - Credit Card & Bank Accounts

POST https://api.xero.com/bankfeeds.xro/1.0/FeedConnections

copy code Request body

{

 "items": [
   {
     "accountToken": "10000123",
     "accountNumber": "3809087654321500",
     "accountName": "Joe's Savings Account",
     "accountType": "BANK",
     "currency": "AUD"
   },
   {
     "accountToken": "10000124",
     "accountNumber": "1234",
     "accountName": "Sam's Credit Card",
     "accountType": "CREDITCARD",
     "currency": "AUD"
   },
   {
     "accountToken": "10000125",
     "accountNumber": "3809087654321501",
     "accountName": "Lu’s Current Account",
     "accountType": "BANK",
     "currency": "AUD"
   },
   {
     "accountId": "87d7b3b9-af8e-4f7e-a7e1-294e6e50b19a",
     "accountToken": "1004560890",
     "accountType": "CREDITCARD",
     "currency": "GBP",
     "country": "GB"
   }
 ]

}

copy code Response body - 202 Accepted

{

 "items": [
   {
     "id": "ac231d36-e7bc-4eb2-ad0f-2ecf328305f1",
     "accountToken": "10000123",
     "status": "PENDING"
   },
   {
     "accountToken": "10000124",
     "status": "REJECTED",
     "error": {
       "type": "feed-already-connected-in-current-organisation",
       "title": "Feed Connection failed",
       "detail": "The AccountToken, AccountNumber or AccountId is already connected to another Xero Bank Account associated with this bank in the selected Xero Organisation."
     }
   },
   {
     "accountToken": "10000125",
     "status": "REJECTED",
     "error": {
       "type": "feed-already-connected-in-different-organisation",
       "title": "Feed Connection failed",
       "detail": "The AccountToken, AccountNumber or AccountId is already connected to another Xero Bank Account associated with this bank. This Xero Bank Account belongs to a different Xero Organisation."
     }
   },
   {
     "id": "880600c2-d302-4b9c-a88a-e0253c926ab2",
     "accountToken": "1004560890",
     "status": "PENDING"
   }
 ]

}

copy code Example of a create Feed Connections request - Multi-Region

POST https://api.xero.com/bankfeeds.xro/1.0/FeedConnections

copy code Request body

{

 "items": [
   {
     "accountToken": "10058695",
     "accountNumber": "3809058454321500",
     "accountName": "Mike's Savings Account",
     "accountType": "BANK",
     "currency": "GBP"
   },
   {
     "accountToken": "10045844",
     "accountNumber": "3809058887441500",
     "accountName": "Gee's Saving's Account",
     "accountType": "BANK",
     "currency": "GBP",
     "country": "GB"
   }
 ]

}

copy code Response: While the response is ‘Accepted’ , each item in the request could have a separate status. The first item has a status of 422 as a result of the ‘Country’ element not being included in the request

Response body - 202 Accepted

{

 "items": [
   {
     "accountToken": "10058695",
     "status": "REJECTED",
     "error": {
       "type": "invalid-country-specified",
       "title": "Invalid or missing country",
       "status": 422,
       "detail": "No matching financial institute found for country specified.",
     }
   },
   {
     "id": "c6bb56d8-debd-465e-b2d0-9d13b5a25da2",
     "accountToken": "10045844",
     "status": "PENDING"
   }
 ]

}

copy code Response body - 400 Bad Request

{

 "items": [
   {
     "accountToken": "10058695",
     "status": "REJECTED",
     "error": {
       "type": "invalid-country-specified",
       "title": "Invalid or missing country",
       "status": 422,
       "detail": "No matching financial institute found for country specified.",
     }
   },
   {
     "accountToken": "10045844",
     "status": "REJECTED",
     "error": {
       "type": "feed-already-connected-in-different-organisation",
       "title": "Feed Connection failed",
       "detail": "The AccountToken, AccountNumber or AccountId is already connected to another Xero Bank Account associated with this bank. This Xero Bank Account belongs to a different Xero Organisation."
     }
   }
 ]

}

copy code Delete Feed Connections POST https://api.xero.com/bankfeeds.xro/1.0/FeedConnections/DeleteRequests

Multiple FeedConnection identifiers can be submitted in a single request. Delete multiple feed connections using their Id or Account Token.

Deleting FeedConnections requires POSTing a collection of FeedConnection identifiers. These identifiers can be either the FeedConnection Id or the AccountToken. These are posted to a subresource FeedConnections/DeleteRequests.

Upon receipt of the request, the Bank Feeds API will perform real time validation of the request, but will defer deletion of the Feed Connections to expedite response times. Successful requests will receive a HTTP 202 Accepted status response indicating successful receipt of the collection of Items.

If multi-region, then you must specify Country.

Id GUID used to identify the Account. AccountToken String(50) unicode

This account identifier is generated by the financial institute (FI).This must be unique for your financial institute. AccountType Enum High level bank account type: BANK or CREDITCARD BANK encompasses all bank account types other than credit cards. Country String(2) ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application Id supports multi-region. Talk to your Partner Manager to confirm if this is the case. Success Response An Accepted response indicates that the deletion request passed validation and that the Feed Connections will be deleted by an out of band process.

As with the POST, items with a status of REJECTED include an Error advising the required action before resubmitting.

If a feed connection is not found for the FeedConnectionId or the AccountToken provided in the request, it is assumed that the feed connection has already been deleted and the response will have a status of PENDING, but there will be an error attached providing more detail. This will not affect the result of the request.

Example of a delete Feed Connections request

POST https://api.xero.com/bankfeeds.xro/1.0/FeedConnections/DeleteRequests

copy code Request body

{

 "items": [
   {
     "id": "50d3cf8d-95dc-4466-8dc0-47e6d1197e28"
   },
   {
     "accountToken": "10000123"
   }
 ]

}

copy code Response body - 202 Accepted

{

 "items": [
   {
     "id": "50d3cf8d-95dc-4466-8dc0-47e6d1197e28",
     "status": "PENDING"
   },
   {
     "accountToken": "10000123",
     "status": "REJECTED",
     "error": {
       "type": "feed-connected-in-different-organisation",
       "title": "Feed connected in different organisation",
       "detail": "The AccountToken is connected to another Xero Bank Account associated with this bank. This Xero Bank Account belongs to a different Xero Organisation."
     }
   }
 ]

}

copy code Example of a delete Feed Connections request - Multi-Region

For this example we are using the AccountToken as basis to identify what will be deleted. The first item does not contain the Country element while the second item does.

POST https://api.xero.com/bankfeeds.xro/1.0/FeedConnections/DeleteRequests

copy code Request body

{

 "items": [
   {
     "accountToken": "053351763838CUHKD"
   },
   {
     "accountToken": "5161615125463625",
     "country": "GB"
   }
 ]

}

copy code The response has a status of Accepted as the request passed the initial validation and the attempt to delete the connections will be done by an out of band process.

Response body - 202 Accepted

{

 "items": [
   {
     "accountToken": "053351763838CUHKD",
     "status": "REJECTED",
     "error": {
       "type": "invalid-country-specified",
       "title": "Invalid or missing country",
       "status": 422,
       "detail": "No matching financial institute found for country specified."
     }
   },
   {
     "id": "7f56c774-18c7-41fd-88ba-6ac2c1ce1eed",
     "accountToken": "5161615125463625",
     "status": "PENDING"
   }
 ]

}

copy code The first item has a status of REJECTED as the Country element was not specified. The second request had a status of PENDING as the request contained all the needed elements.

Explore Xero's APIs Accounting Assets Bank feeds Files Finance API Xero Payroll Practice Manager Xero Projects WorkflowMax Xero HQ Xero Developer Home

Search Sign up Log in Build Grow with Xero Build for Clients Docs OAuth SDKs and tools API reference How-to guides Webhooks Community Forum archive Feature request Find a developer GitHub Media News Dev blog Roadmap API status Support Our team Contact us FAQ Twitter YouTube Instagram About Xero We are hiring! Terms of Service Xero ecosystem principles Navigated to Feed Connections

The __NOEDITSECTION__ tag in any template affects both that template, the pages it's included on, and any other templates included on the same page.

{{fake heading}} can be used in templates and help pages where the appearance of a heading is desired without showing in the table of contents and without an edit link.