# C++: RPC callback contains no id

**URL:** <https://forum.heroiclabs.com/t/c-rpc-callback-contains-no-id/1939>\
**Category:** Client Libraries\
**Tags:** sdk-cpp\
**Created:** [September 8, 2021, 2:06pm UTC](https://forum.heroiclabs.com/t/c-rpc-callback-contains-no-id/1939 "2021-09-08T14:06:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chakie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/chakie/32/772_2.png) [@chakie](https://forum.heroiclabs.com/u/chakie)\
**Post date:** [September 8, 2021, 2:06pm UTC](https://forum.heroiclabs.com/t/c-rpc-callback-contains-no-id/1939/1 "2021-09-08T14:06:37Z")

</div>

Hi,

I’m using the C++ API for making a multiplayer simple client for a game developed in Unity. This client is just for connecting to matches and basically being a development time “bot”. The API works fine and I can connect, seek matches, join matches etc. Now I need to run a few RPC calls to get some data from the server. The one RPC call that I tried so far works kinda ok, but the response is missing important data. My code is like below:

```auto
NClientPtr client;
NSessionPtr session;
...
client->rpc(session, "get_stuff", opt::nullopt, rpcOkCallback, errorCallback);
...

void rpcOkCallback(const NRpc& rpc) {
    std::cout << "RPC data received" << std::endl;
    std::cout << " id: " << rpc.id << std::endl;
    std::cout << " payload: " << rpc.payload << std::endl;
    std::cout << " HTTP key: " << rpc.httpKey << std::endl;
}

```

This gives me:

```auto
RPC data received
    id:
    payload: <correct JSON data>
    HTTP key:

```

The `payload` contains what it should, but the `id` and `httpKey` fields are always empty. I would assume that `id` should be `get_stuff` in this case. I also can’t really find any docs at all that would explain what values they can have, but the `NRpc` struct implies that all fields should always be populated:

```auto
    /// Execute an Lua function on the server.
    struct NAKAMA_API NRpc
    {
        std::string id; ///< The identifier of the function.
        std::string payload; ///< The payload of the function which must be a JSON object.
        std::string httpKey; ///< The authentication key used when executed as a non-client HTTP request.
    };

```

It’s in our case a Go function, but I assume the mention of Lua in the comment is just bit rot.

So, should the `id` be filled in or do I need to keep track of what RPC call I’m currently executing.

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [September 8, 2021, 5:37pm UTC](https://forum.heroiclabs.com/t/c-rpc-callback-contains-no-id/1939/2 "2021-09-08T17:37:26Z")

</div>

Hey @chakie this looks like an oversight on the server itself. Could you file an issue on Nakama on Github? [GitHub - heroiclabs/nakama: Distributed server for social and realtime games and apps.](https://github.com/heroiclabs/nakama)

---

<div class="post-metadata">

**Author:** ![chakie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/chakie/32/772_2.png) [@chakie](https://forum.heroiclabs.com/u/chakie)\
**Post date:** [September 8, 2021, 6:33pm UTC](https://forum.heroiclabs.com/t/c-rpc-callback-contains-no-id/1939/3 "2021-09-08T18:33:18Z")

</div>

Ok, so it’s something that affects all SDK:s? I created an issue [Reply to RPC call from the C++ SDK is missing data · Issue #688 · heroiclabs/nakama · GitHub](https://github.com/heroiclabs/nakama/issues/688) but mostly just linked back to this question.

---

<div class="post-metadata">

**Author:** ![chakie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/chakie/32/772_2.png) [@chakie](https://forum.heroiclabs.com/u/chakie)\
**Post date:** [September 10, 2021, 9:35am UTC](https://forum.heroiclabs.com/t/c-rpc-callback-contains-no-id/1939/4 "2021-09-10T09:35:48Z")

</div>

Well, the issue was closed immediately. Maybe the docs should be updated to reflect in what cases a struct like `NRpc` is supposed to contain values.
