Skip to main content

Best Practices

References to Entities

To make the most of our API, we recommend storing all ids you use locally.

For example, we now have a system for which we want to build an integration, which we use to create projects. In this system, the user now added a Project with the ID "P1337". An event gets triggered that will create a folder in MemoMeister too. It will give you an id and all other requested fields. This id we then save in a 1:1 mapping somewhere locally.

For example, a simple JSON could look like

{
"P1337": "Zm9sZGVyOjYyN2ZlOTlhMjYxNzNhNDFlNGVlNTc5Mg=="
}

As we now have mapped the internal ID with the MemoMeister ID, we can easily update MemoMeister when something changes in our internal system, e.g., changed the location or the description. We only have to look up which MemoMeister ID we have to use in that mapping. No folder search is required.

From now on, with the folder example, you could fetch the folder with this query:

# Single Folder
query Folder($id: String!) {
folder(id: $id) {
id
name
description
# other fields
}
}

# Multiple Folders at once
query Folders($ids: [String]!) {
foldersById(ids: $ids) {
edges {
node {
id
name
description
# other fields
}
}
}
}

Similar queries are there for documents, labels, and users too.