Composite ID inside the resource object

I think that’s a reasonable approach, but if you’re not convinced I can think of another option - model the likes as a relationship on the album rather than on the photo. Then you could add a new one like [quote]
POST /albums/345/likes

{ “data”:
“type”: “like”,
“relationships”: {
“photo”: { “type”: “photo”, “id”: “4” },
“user”: {“type”: “user”, “id”: “480” }
}
}
[/quote]

That would seem to make it more obvious that this like is relevant to this album only.