This function allows you to comment on different content types

Arguments

user

A labstep user object. Must contain an `api_key` field. Returned from `login` commande

object

The labstep object you want to comment on. Can be `protocol`, `experiment` or `resource`

body

The body of the comment in plain text.

Value

Returns a `comment` object

Examples

user <- login("demo@labstep.com","demopassword") expName = 'My First Experiment' expDesc = 'An experiment testing the labstepR library' experiment <- createExperiment(user,expName,expDesc) commentBody = 'An experiment testing the labstepR library' comment <- addComment(user,experiment,commentBody) print(comment)
#> $locked_at #> NULL #> #> $id #> [1] 54766 #> #> $created_at #> [1] "2020-01-30T16:39:24+00:00" #> #> $updated_at #> [1] "2020-01-30T16:39:24+00:00" #> #> $deleted_at #> NULL #> #> $body #> [1] "An experiment testing the labstepR library" #> #> $author #> $author$id #> [1] 4524 #> #> $author$username #> [1] "demo@labstep.com" #> #> $author$name #> [1] "Demo Labstep" #> #> $author$first_name #> [1] "Demo" #> #> $author$last_name #> [1] "Labstep" #> #> $author$profile #> $author$profile$id #> [1] 5751 #> #> $author$profile$photo #> NULL #> #> #> #> $thread #> $thread$all_comment_count #> [1] 1 #> #> $thread$comment_count #> [1] 1 #> #> $thread$id #> [1] 673384 #> #> #> $resource #> NULL #> #> $comment_molecule #> NULL #> #> $comment_post #> NULL #> #> $comment_table #> NULL #> #> $files #> list() #> #> $permissions #> $permissions$view #> [1] TRUE #> #> $permissions$edit #> [1] TRUE #> #> $permissions$owner #> [1] TRUE #> #>