With the Messages capability on Autotrader Connect, you will have the ability to read and reply to messages that are part of a deal.
Here's a full list of the functionality:
- View messages
- Mark messages as read
- Send messages
- Send a new message
- Reply to an existing message
View messages
As part of this capability, you will be able to view any messages from consumers associated with a deal.
To view these messages, you need to make a GET request to the Messages API, with the messages component ID from the deal object and the advertiser ID the deal is associated with.
This will show you:
- Whether the message is unread or read by the consumer and dealer
- The last time the messages were read by the consumer and dealer
- An array of all the messages
Check out an example of viewing messages
Mark messages as read
Once the advertiser has read a message from the consumer, mark the message as read.
To do this, you need to send a PATCH request to the Messages API, with the messages component ID from the deal object and the advertiser ID the deal is associated with. The body of the request should contain a JSON object with the advertiserLastReadStatus set to “Read”.
Check out an example of marking a message as read
Send messages
You can also message the consumer through the Messages API, which will keep all messages for that deal visible to both the dealer and consumer through Autotrader.
To send a message to the consumer, a POST request should be submitted to the Messages API with the advertiser ID in the query string of the request. The body of the request will depend on whether you are sending the first message of the deal, or whether it is a reply to an existing message.
Send a new message
If you want to send a message and there is no messages component ID in the deal object, the POST request should contain the deal ID of the deal you want to send a message for and the message text that you would like to send to the consumer.
Reply to an existing message
If there is already a messages component on the deal, then the POST request should the messages component ID you want to send a reply to and the message text you would like to send to the consumer.
Check out examples of these requests
Error handling
When using the APIs above, you may get error response codes that you need to handle. This makes sure you have a smooth service for both you, as a partner, and your end user.