# Table of contents:
# Introduction
The Offline Instant Messaging (OIM) service, is a SOAP (XML) Web Service. It was introduced with MSNP11, though it was not used until MSNP13.
It's default HTTPS URL is https://ows.messenger.msn.com/OimWS/oim.asmx.
Not to be confused with the Offline Message Inbox.
# Authentication
This service requires Passport Authentication, either using Passport SSI 1.4 or Passport SOAP (RST).
Read the section on the <Ticket> element about this.
# Actions
Either https://messenger.msn.com/ws/2004/09/oim/Store or http://messenger.live.com/ws/2006/09/oim/Store2.
There is no known difference between either Store or Store2, other than the new domain.
The http://messenger.live.com/ws/2006/09/oim/Store2 action was introduced with MSNP15.
# Client/Request
The following sub-headings are XML elements for the client's request.
# soap:EnvelopeThis element has three attributes:
xmlns:soap: This is always set tohttp://schemas.xmlsoap.org/soap/envelope/.xmlns:xsi: This is always set tohttp://www.w3.org/2001/XMLSchema-instance.xmlns:xsd: This is always set tohttp://www.w3.org/2001/XMLSchema.
This element has four children:
<From>: Described below.<To>: Described below.<Ticket>: Described below.<Sequence>: Described below.
This element has seven attributes:
memberName: The user handle of the user that is sending this message.friendlyName: A RFC2047-encoded version of your friendly (display) name. NOTE: There can only be up to 48 characters in the encoded friendly (display) name.xml:lang: The ISO 639-1 language code for this client.proxy: This is always set toMSNMSGR.xmlns: This is always set tohttp://messenger.msn.com/ws/2004/09/oim/.msnpVer: This is your protocol dialect in it's full name.buildVer: The version triplet of the client you are using.
This element has two attributes:
memberName: The user handle of the user to send this message to.xmlns: This is always set tohttp://messenger.msn.com/ws/2004/09/oim/.
This element has three attributes and only one optional attribute:
passport: This is the XML-encoded Passport Compact token formessenger.msn.com.appid: The public key (application ID) for this client.lockkey: Optional. The MSNP11 challenge response for the challenge given.xmlns: This is always set tohttp://messenger.msn.com/ws/2004/09/oim/.
This element has only one attribute:
xmlns: This is always set tohttp://schemas.xmlsoap.org/ws/2003/03/rm.
This element has two children:
<Identifier>: Described below.<MessageNumber>: Described below.
This element has only one attribute:
xmlns: This is always set tohttp://schemas.xmlsoap.org/ws/2002/07/utility.
This element's inner text is always http://messenger.msn.com
This element's inner text should contain the same number used for the X-OIM-Sequence-Num header.
This element has two children:
<MessageType>: Described below.<Content>: Described below.
This element's inner text is always set to text.
This element's inner text contains the MIME-formatted message.
Notable headers of such are these five:
Content-Type: This is usuallytext/plain; charset=UTF-8ormultipart/alternative.Content-Transfer-Encoding: This is always set tobase64.X-OIM-Message-Type: This is always set toOfflineMessage.X-OIM-Run-Id: The formatted GUID for the thread this message belongs to.X-OIM-Sequence-Num: This is the sequence ID for the thread. Use1if this is the first message.
# Server/Response
The following sub-headings are XML elements for the server's response.
# soap:EnvelopeThis element has three attributes:
xmlns:soap: This is always set tohttp://schemas.xmlsoap.org/soap/envelope/.xmlns:xsi: This is always set tohttp://www.w3.org/2001/XMLSchema-instance.xmlns:xsd: This is always set tohttp://www.w3.org/2001/XMLSchema.
This element has only one child:
<SequenceAcknowledgment>: Described below
This element has only one attribute:
xmlns: This is always set tohttp://schemas.xmlsoap.org/ws/2003/03/rm.
This element has two children:
<Identifier>: Described below.<AcknowledgmentRange>: Described below.
This element has only one attribute:
xmlns: This is always set tohttp://schemas.xmlsoap.org/ws/2002/07/utility.
This element's inner text contains the <Identifier> you sent in the request.
This element has two attributes:
Upper: The upper bounds of acknowledged IDs.Lower: The lower bounds of acknowledged IDs.
This element has only one child:
<StoreResponse>: Described below.
This element has only one attribute:
xmlns: This is always set tohttp://messenger.msn.com/ws/2004/09/oim/.
This element has only one child:
<PointsConsumed>: The number of 'points' consumed to send this message. Usually0.
# Examples
# Client/Request
POST /OimWS/oim.asmx HTTP/1.1
SOAPAction: https://messenger.msn.com/ws/2004/09/oim/Store
Cache-Control: no-cache
Content-Type: text/xml; charset=utf-8
Content-Length: 1380
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>
<soap:Header>
<From
memberName="example@hotmail.com"
friendlyName="=?utf-8?B?RXhhbXBsZSBVc2Vy?="
xml:lang="en-us"
proxy="MSNMSGR"
xmlns="http://messenger.msn.com/ws/2004/09/oim/"
msnpVer="MSNP14"
buildVer="8.0.0787"
/>
<To memberName="anotheruser@hotmail.com" xmlns="http://messenger.msn.com/ws/2004/09/oim/"/>
<Ticket
passport="t=ticket&p=profile"
appid="PROD0112J1LW7%NB"
lockkey="7cc3d03d3ca73f49bc47a9d72b839a9c"
xmlns="http://messenger.msn.com/ws/2004/09/oim/"
/>
<Sequence xmlns="http://schemas.xmlsoap.org/ws/2003/03/rm">
<Identifier xmlns="http://schemas.xmlsoap.org/ws/2002/07/utility">http://messenger.msn.com</Identifier>
<MessageNumber>1</MessageNumber>
</Sequence>
</soap:Header>
<soap:Body>
<MessageType xmlns="http://messenger.msn.com/ws/2004/09/oim/">text</MessageType>
<Content xmlns="http://messenger.msn.com/ws/2004/09/oim/">MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64
X-OIM-Message-Type: text
X-OIM-Run-Id: {62554900-7F16-489B-8484-B2C49DA78FD6}
X-OIM-Sequence-Num: 1
VGhpcyBpcyBhIG1lc3NhZ2Uu</Content>
</soap:Body>
</soap:Envelope>
# Server/Response
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: 669
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<soap:Header>
<SequenceAcknowledgment xmlns="http://schemas.xmlsoap.org/ws/2003/03/rm">
<Identifier xmlns="http://schemas.xmlsoap.org/ws/2002/07/utility">http://messenger.msn.com</Identifier>
<AcknowledgmentRange Upper="1" Lower="1" />
</SequenceAcknowledgment>
</soap:Header>
<soap:Body>
<StoreResponse xmlns="http://messenger.msn.com/ws/2004/09/oim/">
<PointsConsumed>0</PointsConsumed>
</StoreResponse>
</soap:Body>
</soap:Envelope>