API: Client Contact Update

Is there a way to update a single contact for a client, rather than the whole client itself?

If not, is this planned at all?

Ignore my initial response, I looked at the XSD schema and most of the fields are optional, so yes this can be done. You only need to supply the main ClientID.

In the ClientContacts node you can then supply just the information needed to modify the contact credentials.

Trying the below code but I’m getting errors?

<Client_Update  xmlns="http://www.QuickFile.co.uk"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.QuickFile.co.uk http://www.quickfile.co.uk/WebServices/API/Schemas/invoices/Client_Update.xsd">
    <Header>
        <MessageType>Request</MessageType> 
        <SubmissionNumber>56as4d56sa4d8as5d584asdsadsd</SubmissionNumber>
        <Authentication>
            <AccNumber>6131441444</AccNumber>
            <MD5Value>aa8ed60073c1309c0e5b2848e7fa494d</MD5Value>
             <ApplicationID>9aca128c-1963-40ff-81b0-e67c01d5cd27</ApplicationID>
        </Authentication>
    </Header>
    <Body>
        <ClientDetails>
            <ClientID>857634</ClientID>
        </ClientDetails>
        <ClientContacts>
            <DefaultContact>
                 <ClientContactID>297701</ClientContactID>
                 <FirstName>Some</FirstName>
                 <Surname>Contact</Surname>
                 <Telephone>01234567890</Telephone>
                 <Telephone>0123456788888</Telephone>
            </DefaultContact>
      <AdditionalContact>
        <ClientContactID>297702</ClientContactID>
        <FirstName>Another</FirstName>
        <Surname>Contact</Surname>
        <Email>******************</Email>
      </AdditionalContact>
        </ClientContacts>
    </Body>
</Client_Update>

In the sand box, I’m getting:

<Errors>
<Error>39The element 'DefaultContact' in namespace 'http://www.QuickFile.co.uk' has incomplete content. List of possible elements expected: 'http://www.QuickFile.co.uk:Email'.</Error>
<Error>46The element 'AdditionalContact' in namespace 'http://www.QuickFile.co.uk' has incomplete content. List of possible elements expected: 'http://www.QuickFile.co.uk:Password'.</Error>
</Errors>

All I’ve tried to do is update one client’s details (but have included all clients)

Ah ok, the AdditionalContact information will need to be supplied in full and in the order specified on the schema. If you refer to the second screenshot in my previous post all the elements with a solid border are mandatory.

Is that what you were referring to in your original post, i,e, a way to update the client contact without supplying all fields in the AdditionalContact container, as I assumed you were referring to the full client record?

I definitely think you need to be able to update client contacts without having to supply the password each time as this puts the onus on you to know the plain text password, so not ideal!

I was referring to updating any client information without supplying any client info apart from the ID.

I see what you mean now after re-looking at the diagrams above. However, if you could get the password thing changed I think that would be a great help :). Other than that, everything unspecified (phone number for example, or company address) - would that remain unchanged?

In the yellow box for the ClientContactBaseType all solid border elements would need to be supplied as it stands. There’s no option there to partially update individual elements (e.g. the email) without also supplying the FirstName, Surname, Email and Password.

I’ve asked for the password to always be optional, I don’t think it will be easy to make the other items optional as this block is also used for creating new client contacts as well as updates.

I think I could work with the email field being left as is. But I agree that the password field would need to be optional.

OK it’s on our short term list, so we should have the updated within the next 2 weeks.

Just coming back to this @Glenn, what would be the correct way to create a new contact for an existing client?

I’ve tried the below (because there’s already a default contact in place), but it throws back an error (also below).

<Client_Update  xmlns="http://www.QuickFile.co.uk"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.QuickFile.co.uk http://www.quickfile.co.uk/WebServices/API/Schemas/invoices/Client_Update.xsd">
    <Header>
        <MessageType>Request</MessageType> 
        <SubmissionNumber>89372ioj3ehuefy7775454354</SubmissionNumber>
        <Authentication>
            <AccNumber>6131441444</AccNumber>
            <MD5Value>2bbeb7957e30267d9b5a0da61699131d</MD5Value>
             <ApplicationID>9aca128c-1963-40ff-81b0-e67c01d5cd27</ApplicationID>
        </Authentication>
    </Header>
    <Body>

        <ClientDetails>
            <ClientID>857634</ClientID>
        </ClientDetails>

        <ClientContacts>
            <AdditionalContact>
                <FirstName>Sarah</FirstName>
                <Surname>Whitely</Surname>
                <Telephone>0207 937 6678</Telephone>
                <Telephone>0207 937 6666</Telephone>
                <Email>andromeda@quickfile.co.uk</Email>
                <Password>1234567</Password>
            </AdditionalContact>
        </ClientContacts>
    </Body>
</Client_Update>

And the error:

<Errors><Error>Your must supply a ClientLoginID to update a client contact record</Error></Errors>

I can’t even see a ClientLoginID in the schema?

I know my colleague has been looking at this today, some issues were identified and are being worked on at the moment. The main issue here is in it’s current form this API method can’t update client contacts, only modify existing ones.

We’re planning to do a release by Wednesday and hopefully we’ll have this implemented by then. I’m sorry to delay you on this. I will update you ASAP.

EDIT:

I have checked with my colleague and it turns out the Client_Update method was never designed to allow contact inserts, only contact updates. We are no working on a completely separate API method called Client_InsertContact which will allow single contacts to be added.

Again I will update you as soon as this is available.

No need to apologise - I understand you have a lot of work on at the moment!

Great to see more progress heading our way though :slight_smile:

1 Like

Just a quick one to let you know we’ve now added a new API method called Client_InsertContacts. You will find this new method in the dropdown menu in the sandbox area.

XSD Schema

XML Example

<Client_InsertContacts  xmlns="http://www.QuickFile.co.uk"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.QuickFile.co.uk http://www.quickfile.co.uk/WebServices/API/Schemas/invoices/Client_InsertContacts.xsd">
    <Header>
        <MessageType>Request</MessageType> 
        <SubmissionNumber>00000001</SubmissionNumber>
        <Authentication>
            <AccNumber>6131400000</AccNumber>
            <MD5Value>-----------------</MD5Value>
             <ApplicationID>-----</ApplicationID>
        </Authentication>
    </Header>
    <Body> 
        
            <ClientID>28</ClientID> 
            <ClientContacts>
				 <AdditionalContact> 
					<FirstName>Sarah</FirstName>
					<Surname>Whitely</Surname>
					<Telephone>0207 937 6678</Telephone>
					<Telephone>0207 937 6666</Telephone>
					<Email>andromeda@quickfile.co.uk</Email>
					<Password>abc456</Password>
				</AdditionalContact> 
            </ClientContacts>
           
    </Body>
</Client_InsertContacts>
1 Like

That’s great news! Thanks Glenn (and team)!

Am I correct in thinking that when you want to update a contact, you just do client_update and send all the contacts with it?

No problem!

That is correct yes, just include the contact you want to update along with all the required fields.

1 Like

Thanks @Glenn. Just started using the new API Functionality - works a treat :wink:

One last question (hopefully) - is there a way to remove a contact via the API?

Excellent!

You should be able to delete contact records using the Client_Delete method:

Smashing!

And lastly (I hope!), if a contact was made a primary contact (originally just ‘additional’), would you just do Client_Update and insert the ContactID there instead? I have tried this, but it just simply updated the contact as an additional contact:

    <Body>    
        <ClientDetails>
            <ClientID>857634</ClientID>
        </ClientDetails>    
        <ClientContacts>
            <DefaultContact>
                <ClientContactID>375100</ClientContactID>
                <FirstName>Some</FirstName>
                <Surname>Person</Surname>
                <Telephone>0800 566 8249</Telephone>
                <Email>marmaduke@ppmbs.co.uk</Email>
            </DefaultContact>    
        </ClientContacts>
    </Body>
</Client_Update>

I also noticed that originally, that contact in question had no email address, which must have been created via the API. If you do keep a record of data in and out, take a look at submission number 2992-CRMTest1416758750 for the above application.

I’m not entirely sure how this works in terms of changing the default contact? I’ll discuss this and the other point you raised with my colleague this morning.

EDIT:

We’ve made a number of changes to the API method that will address both issues raised. We should have this rolled out by mid week.

1 Like

Great News - Thank You. Brilliant, as always! :slight_smile:

1 Like

Apologies, this was a bit later than planned.

You should now be able to convert an AdditionalContact to a DefaultContact by running the update API method and placing the contact credentials in the DefaultContact node.

We’ve also addressed the null email issue you reported.

EDIT:

I should also add, we’ve updated our API area:

http://api.quickfile.co.uk/

There’s a dedicated page for each API method, e.g.

http://api.quickfile.co.uk/1_1/methodView.aspx?schema=Client_Update

The diagrams are clickable so you can now drill down on the schema.

1 Like