Skip to main content
Published: March 11 2016, 5:37:00 AMUpdated: August 15 2022, 11:43:26 PM

I try and submit extra line breaks with AddMemberMessageRTQ (or related calls).  The API seems to "eat" the "extra" line breaks.  How I can send a message that is spaced correctly?

I want this:

Hello Customer,

Have a nice day!
- The Seller

and not:

Hello Customer,
Have a nice day,
- The Seller

To add the line breaks, you can use encoded characters in the message you're sending.  A hex-encoded character looks like this: 
 where '13' is the decimal ASCII character code you want to output in the message.  You can get a list of ASCII characters at http://www.asciitable.com/.

The characters you're interested in are 
 and 
, which are a 'linefeed' and 'carriage return' character, respectively.  These two characters are written to an application whenever you press the 'enter' key.  This is what causes the cursor to go to the next line.

However, using these characters doesn't get around the problem illustrated in the solution.  If you want to prevent the API from 'eating' the 'extra' line break, you need to put a character in between the first line break and the second.  One character you can use is a space.  With that in mind, let's see what text you would send to get the following message:

Message to the customer

Dear Valued Customer,

Thanks for your interest in our product.  We will get back to you soon.

Sincerely,
The Seller

 

AddMemberMessageRTQRequest 
  <?xml version="1.0" encoding="utf-8" ?>
- <AddMemberMessageRTQRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <ItemID>110034980018</ItemID>
- <MemberMessage>
  <Body>Dear Valued Customer,&#13;&#10; &#13;&#10;Thanks for your interet in our product.  We will get back to you soon.&#13;&#10; &#13;&#10;Sincerely,&#13;&#10;The Seller</Body>
  <ParentMessageID>690052</ParentMessageID>
  <RecipientID>testuser_timeline</RecipientID>
  </MemberMessage>
- <RequesterCredentials>
  <eBayAuthToken>XXXXXXXXXX</eBayAuthToken>
  </RequesterCredentials>
  </AddMemberMessageRTQRequest>

Note the space between &#10; and the following &#13.  If you omit this space, the extra line break will be removed when the API call is made, and your message won't look like you expect.

You can get a similar effect without resorting to the encoded characters as well.  If you type the body like you want it, and make sure to add a space on the blank lines, you can achieve the formatting you want as well.

Formatted Message without Encoded Characters

Dear Valued Customer,
 (a space character is on this 'blank' line)
Thanks for your interest in our product.  We will get back to you soon.
  (a space character is on this 'blank' line)
Sincerely,
The Seller

How well did this answer your question?
Answers others found helpful