ContactWebService

public interface ContactWebService

Webservice interface for RapidPro REST API for Contacts.

Methods

createOrUpdateContact

Contact createOrUpdateContact(Contact contact)

Creates a new contact or updates an existing contact. If the dto has a value for UUID, the contact will be updated. Otherwise, it will create a new contact with those fields.

Parameters:
  • contact – A representation of a Contact
Throws:
  • WebServiceException
Returns:

Contact The body of the response from RapidPro

deleteContactByUUID

void deleteContactByUUID(UUID uuid)

Deletes a contact by its UUID, if it exists

Parameters:
  • uuid – The rapidpro UUID of the contact.
Throws:
  • WebServiceException

getContactByPhoneNumber

Contact getContactByPhoneNumber(String phoneNumber)

Finds a contact with the phone number, if it exists.

Parameters:
  • phoneNumber – The unique phone number of the Contact
Throws:
  • WebServiceException
Returns:

Contact

getContactByUUID

Contact getContactByUUID(UUID uuid)

Finds a contact with the corresponding UUID, if it exists.

Parameters:
  • uuid – The rapidpro UUID of the contact
Throws:
  • WebServiceException
Returns:

Contact A representation of the contact.