MessagesApi

@interface MessagesApi : NodeDependant

Provides access to Textile messages related APIs

  • Add a text message to a thread

    Declaration

    Objective-C

    - (nonnull NSString *)add:(nonnull NSString *)threadId
                         body:(nonnull NSString *)body
                        error:(NSError *_Nullable *_Nullable)error;

    Swift

    func add(_ threadId: String, body: String, error: NSErrorPointer) -> String

    Parameters

    threadId

    The id of the thread to add the message to

    body

    The body of the message

    error

    A reference to an error pointer that will be set in the case of an error

    Return Value

    The hash of the newly created message block

  • List messages for a thread

    Declaration

    Objective-C

    - (id)list:(nullable NSString *)offset
           limit:(long)limit
        threadId:(nonnull NSString *)threadId
           error:(NSError *_Nullable *_Nullable)error;

    Swift

    func list(_ offset: String?, limit: Int, threadId: String) throws -> Any

    Parameters

    offset

    The offset to query from

    limit

    The max number of messages to return

    threadId

    The id of the thread to query

    error

    A reference to an error pointer that will be set in the case of an error

    Return Value

    An object containing a list of messages