I have created a timeline card with a custom menu item. I would like to get a callback when the user has selected that menu item. 

```
// Create a menu item for the card
var mnuActivate = new MenuItem() {
    Action = "CUSTOM",
    RemoveWhenSelected = new bool?(true),
    Id = ACCEPT_ID,
    Values = new List<MenuValue>() {
        new MenuValue() {
            State="DEFAULT",
            DisplayName="Activate",
        },
        new MenuValue() {
            State="PENDING",
            DisplayName="Activating..."
        },
        new MenuValue() {
            State="CONFIRMED",
            DisplayName="Activated"
        }
    }
}

// Create a new card for the user's timeline
var item = new TimelineItem() {
    Html = html,
    Notification = new NotificationConfig() { Level = "DEFAULT" },
    MenuItems = new List<MenuItem>() { mnuActivate }
};

var card = this._service.Timeline.Insert(item).Fetch();

```

I then subscribe to all timeline events and provide an https callback URL
```
 // Create a new subscription
var subscription = new Subscription()
{
    Collection = "timeline",
    Operation = new List(),
    CallbackUrl = "<https://mypubliclyavailableserver.com/notify>"
};
this._service.Subscriptions.Insert(subscription).Fetch();
// Retrieve a list of subscriptions to make sure it is there.
var mySubcriptions = this._service.Subscriptions.List().Fetch();
if (mySubcriptions != null && mySubcriptions.Items != null && mySubcriptions.Items.Count == 1)
{
    Console.WriteLine("Subscription created successfully.");
}
```

So the subscription is created without any issues as far as I can tell. But after interacting with the card, I never get a callback. What am I missing?

Things I have tried:

1. Populating Ids on the subscription obj, timeline card, and menuItem
2. Subscribing before creating the card instead of after
3. Adding the userId as the UserToken on the subscription object
4. Calling my callback URL directly to ensure that it is listening

JSON Response from GET /mirror/v1/subscriptions:

```
{
 "kind": "mirror#subscriptionsList",
 "items": [
  {
   "kind": "mirror#subscription",
   "id": "timeline",
   "updated": "2013-10-28T15:19:19.404Z",
   "collection": "timeline",
   "callbackUrl": "https://mypubliclyavailableserver.com/notify"
  }
 ]
}

```
['https://Stackoverflow.com/questions/19600123', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/281336/']
The main thing you need to keep in mind is [endianness](http://en.wikipedia.org/wiki/Endianness). That is, the order the bytes are interpreted in is different on different platforms.

For example, your Intel CPU might interpret the byte string `0x01 0x00` to be the number 1, but someone else's PowerPC would interpret that string of bytes to be the number 256.

When building a network protocol, it's important to keep issues like this in mind. (you might look at something like [Google Protocol Buffers](https://code.google.com/p/protobuf/), which was designed to address this concern)

Since you're only talking about two bytes, you should also take a look at the `htons()` macro. This converts a 2-byte value from *host order* to *network order*. (network order is *big endian*, whereas host order is often *little endian*, but on big endian platforms `htons()` can simply be defined as a no-op.) If you want to send 4-byte (32-bit) values, you should also take a look at the `htonl()` macro. `htons` stands for *host to network short*, and will convert your 16-byte value to an equivalent *network order* 16-bit value (if you are on an Intel CPU, that means it will return a version of the 16-bit integer with the bytes swapped). When you have incoming bytes, your code should use the `ntohs` (and `ntohl`, for 32-bit values) macro to convert the incoming data from network byte order back to host order.
Also, you'd obviously want to send both bytes using a single socket write operation. Don't write one byte and then write the other using two writes as that could end up being very inefficient over the wire. That is, don't write uint8\_t[0] followed by uint8\_t[1]. Writing &uint16\_t will avoid that situation.