Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Getting Started >

Is the GDPRREQUEST ContactStatus accessible?

Started by Richard Heylen -   in Getting Started

Is it possible to set a contact status for an existing contact to GDPRREQUEST?

https://developer.xero.com/documentation/api/types#ContactStatuses

Using the POST method I can create new contacts which have a ContactStatus of GDPRREQUEST but that's not very useful. When I try to use the PUT method with the following body

<Contacts>
<Contact>
<ContactID>c8a32434-8abd-4890-b725-5120ae88b2ab</ContactID>
<ContactStatus>GDPRREQUEST</ContactStatus>
</Contact>
</Contacts>

it fails and complains about the Contact Status

<ApiException xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ErrorNumber>10</ErrorNumber>
<Type>ValidationException</Type>
<Message>A validation exception occurred</Message>
<Elements>
<DataContractBase xsi:type="Contact">
<ValidationErrors>
<ValidationError>
<Message>Contact status code is not valid.</Message>
</ValidationError>
</ValidationErrors>
<ContactID>c8a32434-8abd-4890-b725-5120ae88b2ab</ContactID>
<ContactStatus>GDPRREQUEST</ContactStatus>
</DataContractBase>
</Elements>
</ApiException>

A POST with the following body

<Contacts>
<Contact>
<Name>Gdpr Person</Name>
<ContactStatus>GDPRREQUEST</ContactStatus>
</Contact>
</Contacts>

succeeds and returns

<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Id>c54121cb-7509-4127-a3fa-b2b86d74ed46</Id>
<Status>OK</Status>
<ProviderName>Xero API Previewer</ProviderName>
<DateTimeUTC>2018-12-20T16:36:45.3812599Z</DateTimeUTC>
<Contacts>
<Contact>
<ContactID>053b9d49-5f40-49b4-a37d-8f811f8700a6</ContactID>
<ContactStatus>GDPRREQUEST</ContactStatus>
<Name>Gdpr Person</Name>
<Addresses>
<Address>
<AddressType>STREET</AddressType>
</Address>
<Address>
<AddressType>POBOX</AddressType>
</Address>
</Addresses>
<Phones>
<Phone>
<PhoneType>DEFAULT</PhoneType>
</Phone>
<Phone>
<PhoneType>DDI</PhoneType>
</Phone>
<Phone>
<PhoneType>FAX</PhoneType>
</Phone>
<Phone>
<PhoneType>MOBILE</PhoneType>
</Phone>
</Phones>
<UpdatedDateUTC>2018-12-20T16:36:45.353</UpdatedDateUTC>
<IsSupplier>false</IsSupplier>
<IsCustomer>false</IsCustomer>
</Contact>
</Contacts>
</Response>
Answer: No.

I've just found https://devblog.xero.com/gdpr-and-the-xero-contact-api-a34708ee43a2
Which includes the following "
It will not be possible for an app to change a contact’s status from “ACTIVE” to “GDPRREQUEST” via the API. This can only be done by Xero at the request of an organisation’s subscriber.
"

Presumably the ability to create new contacts with the GDPRREQUEST status is a bug.
 

Richard Heylen  

@Richard

Thank you posting your update, I'll let the team know.

If you would like to test the GDPRREQUEST status on a test contact, please let us know by emailing api@xero.com with the details of the organisation and contact in question.
 

Robin Blackstone (Xero Staff)