---
title: "How to use the Machine Attributes API"
slug: "how-to-use-the-machine-attributes-api-1"
tags: ["Node-RED", "Machine Monitoring", "Machine Attribute", "API"]
updated: 2024-08-05T20:55:47Z
published: 2024-08-05T20:55:47Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.tulip.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Use the machine attributes API

## How to use the Machine Attributes API

*Create a Tulip Machine using data from Node-RED, Python or other services.*

          NOTE

          

Advanced Article - assumes previous experience with REST APIs.Click [here](https://support.tulip.co/apidocs) to view our Machines API documentation.

## Summary

The Machine Attributes API allows you to send data to a specific attribute of a [Machine](https://support.tulip.co/docs/intro-to-machine-monitoring) via a RESTful API using the `/attributes/report` endpoint. This enables many flexible options to integrate with Tulip from Node-RED, Python or other languages and services.

## Setting up the Machine API

Note: If you have a [Tulip Table API](https://support.tulip.co/docs/how-to-use-the-table-api) already set up, you may use that API Key and Secret

1. Navigate to your **Settings > API Tokens**
2. Click **Create API Token** in the upper right-hand corner of your screen
3. Name your API Token, and select **`attributes:write`** for it's scope:

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20use%20the%20Machine%20Attributes%20API_308117078.png)

1. A modal with your **API Key, Secret** and **Auth Header** will appear. **Please save this information as it can not be accessed again!**

Congratulations - you've officially set up your Machine API!

## Setting up a new Machine

Once you've set up your Machine API, a new Machine Data Source will appear on your instance. To view this datasource click **Shop Floor** > **Machines**, and navigate to **Machine Data Sources:**

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20use%20the%20Machine%20Attributes%20API_299183646.png)

You will have to create a new machine linked to this data source. To create a new machine navigate to **Machine Library**, and click **Create Machine.**

The following modal will appear:

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20use%20the%20Machine%20Attributes%20API_299184555.png)

1. *Machine Name* (Required): Name you machine
2. *Machine Data Source* (Required): Select **Tulip API**
3. *Station* (Optional)
4. *Type* (Required): If no *Type* is available create a type first, in this example the type created is named **default**

Now that your machine is created, you'll need to add an attribute. Click on Edit on the top right of your screen. Then click on the **+** button in the top right of your screen:

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20use%20the%20Machine%20Attributes%20API_457415675.png)

Since no Machine Attributes have been created yet press the Machine Type in blue, in this case its Default.

This will take you to the Machine Type associated with the machine. Press the *Edit* button in the top right corner of your screen.

Then Press the + button next to Machine Attributes in the bottom left corner.

Now press ***+ Create Machine Attribute*** in the bottom right corner

For this example, we will be creating a **Counter** attribute of type **Integer**.

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20use%20the%20Machine%20Attributes%20API_457418550.png)

Once your attribute is created, click the **Counter** Attribute in the list of Machine Attributes and then press the save in the top right corner

Proceed back to your machine page.

Now that your Machine Attribute is created, you can add it to your Machine. Press the *Edit* button in the top right corner. Then click on the **+** button in the top right corner and select the **Counter** attribute you've just created:

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20use%20the%20Machine%20Attributes%20API_308127275.png)

Please click **Save** in the upper right corner.

Your Tulip Instance is now set up with the Machine API, a Machine, and a Machine Attribute - now you can send data to a Tulip Machine from anywhere!

From here you can see the `attributeId` and `machineID` for the *Counter* attribute. This information can be copied by clicking the icon and will be used in the body of the http request.

To do this you will need to be familiar with REST APIs. Full documentation on how to use the `/attributes/report` endpoint, including the query parameters and body format, can be found at *your-company.tulip.co/apidocs* or by following the link on the *API Token* page...

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20use%20the%20Machine%20Attributes%20API_308124025.png)

... and in the docs there is a section for Machine Monitoring

![](https://cdn.document360.io/7c6ff534-cad3-4fc8-9583-912c4016362f/Images/Documentation/How%20to%20use%20the%20Machine%20Attributes%20API_308122257.png)

## Further Reading

[Check out this article](https://support.tulip.co/docs/using-node-red-with-edge-mc) if you want to take the API further and see how it can be used with Edge MC and Node-RED!

**Machine**

A **Machine**is a digital representation of a physical datasource. Machines have **Attributes**that are updated through an OPC-UA Connector or the Tulip API.

**Attribute**

**Attributes**are properties. In Tulip, an attribute generally references a property of a machine. Attributes can be either set points or actuals.

*Ex. Cycle time, Spindle speed, Feed rate, ect.*

**Integer**

**Integers**are a Tulip Datatype. Integers can have any whole number.

*ex. -5, 15, 47, 155. **NOT** 15.2, -12.73*

**Tulip Instance**

A Tulip customer account. Your instance can be found at https://[your-instance].tulip.co

When *your instance*is referenced, we are just talking about your Tulip account on an organization-level, not user-level.
