Xero

Get Xero Contact by Email

Finds the Xero contact ID for one email address.

Unverified

Add this first. This tool needs an access token, so add Get Xero Access Token to the same bot. The bot calls it first and passes the token in.

What the model is told

Find a Xero contact by email address so you have the ContactID needed to create an invoice. Get a Xero access token first if you do not already have one. Only use the email the customer gave you. If nothing is returned, offer to create a contact. Only use the ContactID, name and email from the response and do not read out anything else.

Request

GEThttps://api.xero.com/api.xro/2.0/Contacts?where=EmailAddress%3D%3D%22{{email}}%22&summaryOnly=true

Headers

  • AuthorizationBearer {{accessToken}}
  • xero-tenant-idYOUR_XERO_TENANT_ID
  • Acceptapplication/json

Parameters

  • email stringThe contact's email address.
  • accessToken stringThe access_token value returned by Get Xero Access Token. Reuse it for the rest of the conversation.

Engage payload

{
  "source": "VOICE_AI",
  "tool": {
    "id": "3225f757-7780-4692-8c6c-d316a20e96b9",
    "type": "HTTP_REQUEST",
    "label": "Get Xero Contact by Email",
    "name": "get_xero_contact_by_email",
    "customName": false,
    "description": "Find a Xero contact by email address so you have the ContactID needed to create an invoice. Get a Xero access token first if you do not already have one. Only use the email the customer gave you. If nothing is returned, offer to create a contact. Only use the ContactID, name and email from the response and do not read out anything else.",
    "parameters": [
      {
        "name": "email",
        "type": "string",
        "description": "The contact's email address."
      },
      {
        "name": "accessToken",
        "type": "string",
        "description": "The access_token value returned by Get Xero Access Token. Reuse it for the rest of the conversation."
      }
    ],
    "config": {
      "endpoint": {
        "method": "GET",
        "url": "https://api.xero.com/api.xro/2.0/Contacts?where=EmailAddress%3D%3D%22{{email}}%22&summaryOnly=true"
      },
      "headers": [
        {
          "name": "Authorization",
          "value": "Bearer {{accessToken}}"
        },
        {
          "name": "xero-tenant-id",
          "value": "YOUR_XERO_TENANT_ID"
        },
        {
          "name": "Accept",
          "value": "application/json"
        }
      ],
      "body": null,
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.