fluxsocial / Junto-Holochain-Alpha-API

6 stars 0 forks source link

[Clarification Needed] Post Expression #7

Open Nash0x7E2 opened 5 years ago

Nash0x7E2 commented 5 years ago

What is the expected data type for attributes and context in /post_expression?

{ expression: {expression object data}, attributes: [array of attributes (channels)], context: [array of context(s) addresses] }

jdeepee commented 5 years ago

Hey sorry I should have included some more info in the documentation outlining the various data types. expression follows this data structure:

{ 
    expression_type: "LongForm"/"ShortForm"/"PhotoForm"/"EventForm"/"BulletForm",
    expression: {
        LongForm{
            title: String,
            body: String
        },
        ShortForm{
            background: String,
            body: String
        },
        PhotoForm{
            image: String,
            caption: String
        },
        EventForm{
            title: String,
            date: String,
            location: String,
            details: String
        },
        BulletForm{
            title: String,
            bullets: [String]
        }
    }
}

Only one expression type should be used per request so type longform should have the LongForm object sent also.

attributes: these are channels (topics) as defined by the user. Just an array of strings here. Eric can fill you in more if you are unsure how channels work in the context of the application.

context: these are addresses for given "locations" where a post can be sent. It will usually be one of the following: a group, a den or the collective (public) space. Again just an array of strings containing the addresses is what is needed here. In order to make a collective post you will pass the dna address of the holochain application. This address can be retrieved at get_env.