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.


You might want to duplicate this request on the Dev forum. It’s where all the really clever people hang out :slight_smile:


Very well, I’ll do that. Thank you, James.


I think in line #48:

  appendAppendableData(token, this.appendableDataId, appendableHandle)

you should be passing dataIdHandle (instead of appendableHandle) as the 3rd param, i.e.:

  appendAppendableData(token, this.appendableDataId, dataIdHandle)


So simple. Way to embarrass myself! Thank you.


I wouldn’t say that, it’s good we share this type of doubts here so we can all learn quicker!
Keep up the good work and share your app with us to try it out when ready!


Is there a way for me to return the name of an AppendableData if I have it’s data ID handle?

I’m creating AppendableData’s, naming them different subjects, like biology and botany, and appending them to a primary AppendableData named subjects.

I want to iterate over subjects, retrieve the data ID handles of the appended subjects and obtain the name of each to represent them on the UI for user.


I’m not aware of a way to do it, but even if you are able to get them, they shouldn’t be something readable for a UI as they are the address in the Xor space, right?
I guess you are hashing the subject names.


Ah, yes, I’m hashing the names with sha256. No way to get original name. Okay, thank you for bringing my attention to that.
I’m going to rethink the structure of my nested data.


Perhaps you need an StructuredData which contains the metadata for each of your different subject’s (like subject’s name, etc.) plus its corresponding AppendableData’s handle, then what you append to your main/index AppendableData are the StructuredDatas’ handles.


After updating a StructuredData on line #45, I’m attempting to save those changes on line #34

The PUT operation fails and returns:

description: "CoreError::MutationFailure::MutationError::DataExists"
errorCode: -23

So far I’ve tracked the error to a put function on line #388 of core client mod.

I notice in the comments on the put_recover function below

/// Put data to the network. Unlike `put` this method is blocking and will return success if
/// the data has already been put to the network.

Does that mean my application is ultimately PUTing more than once?

P.S. I’m now catching up with RFC’s and reading about MutableData. Perhaps me learning this version of API is futile, maybe not. Learning, nonetheless.


Problem solved. I was mixing up PUT and POST requests in documentation.

I also learned that I’ve had a completely wrong conception of HTTP request methods. Maybe not completely wrong, although I haven’t truly understood them yet. Good learning.


I’m using POST /data-id/appendable-data with the idea to first check for the existence of the AppendableData that my program is looking for.

What’s deceiving is that for name in

data: {
        isPrivate: false,

I can enter a value for name that I know doesn’t exist and still receive a

    "handleId": <u64>

as if the nonexistent AppendableData did exist.

Thinking that it does exist, I direct my program to then GET /appendable-data/handle/:dataIdHandle, which returns: "CoreError::GetFailure::GetError::NoSuchData"

Does this POST endpoint above not check for the existence of an AD?