Streaming API v29.0 – ID is only 15 characters for delete messages

When we receive a delete message from the Streaming API the ID is only 15 characters not 18.

For example

["Id":"a04K0000008H7ld", "OwnerId":"null", "EventType":"deleted","EventCreatedDate":"2013-12-13T23:10:47.000+0000"]

Is it possible to get the 18 character ID?

Answer

I don’t know of a way to toggle the IDs returned by the API, but you can use these 15 character IDs for all operations, they’re the case sensitive version of an ID.

According to this success article all APIs should be returning 18 character IDs so this could be a quirk of the Streaming API.

You can convert 15 character IDs to 18 character IDs so this may the only option if you really need the 18 character IDs for some reason. There’s an Apex snippet here which shows you how to do that, and there’s a great question on this site about Saelsforce IDs: What are Salesforce IDs composed of?.

Attribution
Source : Link , Question Author : user4843 , Answer Author : Community

Leave a Comment