Help with learning SAFE API as I refactor application

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.

5 Likes