Restore a note
client.Note.Restore(ctx, id, body) (*NoteRestoreResponse, error)
POST/v1/notes/{id}/restore
Restores a trashed note, bringing it back to active. Find trashed notes via GET /v1/notes?status=trashed.
Calling restore on a note that is not trashed is a no-op and returns the existing record.
Required scope: notes:restore
Rate limit category: Write
Restore a note
package main
import (
"context"
"fmt"
"github.com/Lightfld/lightfield-go"
"github.com/Lightfld/lightfield-go/option"
)
func main() {
client := githubcomlightfldlightfieldgo.NewClient(
option.WithAPIKey("My API Key"),
)
noteRestoreResponse, err := client.Note.Restore(
context.TODO(),
"id",
githubcomlightfldlightfieldgo.NoteRestoreParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", noteRestoreResponse.ID)
}
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
],
"directions": {
"asDestination": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
},
"asSource": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
}
}
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
],
"directions": {
"asDestination": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
},
"asSource": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
}
}
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}