This guide aims to get you up and running and familiar with the API in about 15 minutes. We'll teach you how to setup your first user and how to create your first item.
The first thing to do after setup is to create an
.environment.yamlfile that allows you to connect to the sandbox environment.
Create your first user - let's call them "Alice".
meeco users:create -p supersecretpassword > .alice.yaml
The command above does a lot, if you want to learn what happens behind the scenes look at the guide about Setting up Access. The end result is captured in a file
.alice.yamlthat holds the necessary information about the user that allows us to talk to the API in the next steps.
In the next calls, you'll see an argument added with
You can use the following command to login as the user you just created or if you are returning to a session. This command will re-create the tokens if they are expired. It outputs an Authorization config file for use with future commands.
meeco users:login -a .alice.yaml
You can also get the information about a user by using the following command. This command will return the user's id and other user info like their dek.
meeco users:get -a .alice.yaml
Items in the Meeco API require you to specify a template. This template can be seen as a contract with a number of predefined fields (which we call slots). To get all available templates execute the following command
meeco templates:list -a .alice.yaml
Fetching available templates... done
Let's create a
vehicleitem. To prepare this we can run the create config command
First, let's have a look at what kind of information the template holds.
meeco templates:info vehicle -a .alice.yaml
Fetching template 'vehicle'... done
Then, create the config file:
meeco items:create-config vehicle -a .alice.yaml > .item-config.yaml
The next step is to edit the file to contain some data.
- name: purchase_date
- name: type
value: "Sports Car"
- name: vin
- name: licence_plate
- name: model_make
value: "DMC DeLorean"
- name: power
value: "132 PS"
Based on this configuration, we can create a new vehicle in Alice's digital vault.
meeco items:create -i .item-config.yaml -a .alice.yaml > .item.yaml
Congratulations, you have now created your first item in the Vault.
From here you can either keep learning about the Meeco Platform and tools, or jump into the Connections and Sharing tutorial to keep using the CLI to make a connection with another user and share the item you created above.