Help with learning SAFE API as I refactor application

I’m refactoring a conventional app that I created in order to learn the SAFE API.


Creating this thread to post questions that I have along the way. Thank you for your help.

First problem

I’m attempting to append appendable data to another appendable data, ultimately calling PUT /appendable-data/:handleId/:dataIdHandle (

Error response:

description: "FfiError::InvalidDataIdHandle",
errorCode: -1514

I’d like to learn about what I’m doing wrong while also learning about core files:

The appendable_data_append function at appears to be throwing an error at

The get_data_id function ( according to the documentation (, “Returns a mutable reference to the value corresponding to the given key in the cache, if any”

get_data_id, if not an FfiError, should return a mutable reference to DataIdentifier wrapped in a Result. DataIdentifier is an enum that should be one of four data types (

I’m expecting that the data id handle that I’m passing in belongs to a public appendable data.

I need help from here.
As I intend to post further questions in this thread, please let me know if I can improve the format for ease of reading


Hello @hunterlester,

so, let’s unpack what is going on here. So, you have on AppendableData and you want to append it to another AppendableData, correct? Let’s call them Home and Office.

At the current version of the low level API this isn’t super straight forward, as there are multiple handle-named things that aren’t easy to distinguish. Just remember that the DataHandleId essentially is a persistent address to an object in the network (aka XorAddress + TAG_ID). The other handles are internal keys, that you used to communicate to your session which object you are interacting with within that session - think of them as C-style File-Handlers, you use them to identify which file you want to write to within this process. Those are non-permanent, by the primary way you use to talk to your session when you want to change something.

So if you open Home, you get a temporary handleId to mutate and act with that specific item. Now, if you want to add a reference of Home to Office, you need to get a permanent address - the DataHandleId. The way to do this is through the get data-id for appendable-data-API. With the result of that API-call you should be able to do the request you mentioned and get the expected result.

FYI, we is a very verbose and not clearly defined API and requires a lot of very similar terms in your head, which can make it very confusing. Which is why we are intending of replacing this with a much cleaner approach in our current efforts to provide a mobile-friendly development approach. Expect to see a much more refined and clearer API in the next couple of weeks.