In this section you will find step-by-step recipes for integrating the External Contacts API into your product. Below you will find recipes to:
- Add an External Contact
- Retrieve Contact Information
- Update Contact Information
Step | Corresponding Code (JavaScript) |
---|
Determine Required Information For the Contact - Use the /externalContact/requiredInformation and /zonecodes endpoint to determine required information for the external contact based on their country and accountType. | const options = { method: 'GET', headers: { Accept: 'application/json', Authorization: 'Bearer USER' } };
fetch('https://prod.api.getborderless.com/externalContact/requiredInformation', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
fetch('https://prod.api.getborderless.com/zoneCodes', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); |
Create the Request Body and utilize the /externalContacts endpoint - Create the Request Body and utilize the /externalContacts endpoint. | const options = { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', Authorization: 'Bearer USER' } };
fetch('https://prod.api.getborderless.com/externalContact', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); |
Step | Corresponding Code (JavaScript) |
---|
Check for status updates- If the /externalContacts endpoint returns a "PENDING" status, use the /externalContact/status endpoint to check for when the status becomes approved. | const options = { method: 'GET', headers: { Accept: 'application/json', Authorization: 'Bearer USER' } };
fetch('https://prod.api.getborderless.com/externalContact/status', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)) |
Get Contact Information- Use the /contacts/contactInformation endpoint to receive information for the contact. Here you can see if a contact is External or Internal, and if it is a Personal or Business account. | const options = { method: 'GET', headers: { Accept: 'application/json', Authorization: 'Bearer USER' } };
fetch('https://prod.api.getborderless.com/contacts/contactInformation', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); |
Step | Corresponding Code (JavaScript) |
---|
Update Contact's Banking Information - If you need to make changes to your external Contact's banking information you can use the /externalContacts/updateBankingInformation endpoint. | const options = { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', Authorization: 'Bearer USER' } };
fetch('https://prod.api.getborderless.com/externalContact', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); |
Update Contact Information - Update Contact Information with the /contacts/updateContactInformation endpoint. The information you can update varies on account type which you can retrieve from the /contactInformation endpoint. Please refer to the page here | const options = { method: 'POST', headers: { Accept: 'application/json', 'Content-Type': 'application/json', Authorization: 'Bearer USER' } };
fetch('https://prod.api.getborderless.com/externalContact', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); |