//native
type Xero = {
token: string
}
/**
* Retrieve single feed connection based on a unique id provided
* By passing in a FeedConnection Id options, you can search for matching feed connections
*/
export async function main(auth: Xero, id: string, Xero_Tenant_Id: string) {
const url = new URL(`https://api.xero.com/bankfeeds.xro/1.0/FeedConnections/${id}`)
const response = await fetch(url, {
method: 'GET',
headers: {
Accept: 'application/json',
'Xero-Tenant-Id': Xero_Tenant_Id,
Authorization: 'Bearer ' + auth.token
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 515 days ago