API Key

<aside> 🔑 abcdef12345

</aside>

Identity IDs

Example request

The following shell script is an example request for calculating impact. It uses curl and jq, and should work in most environments.

The sample portfolio is composed of four identities: lp68f402174, lp6f8454263, 2fb7k.de, & ievfd.de.

The allocation amount in each identity is taken into account when calculating the overall impact numbers; a higher allocation will contribute more.

Potential example

#!/usr/bin/env sh

API_KEY="YOUR_API_KEY"

# Fetch a JWT token, which gives access to impact calculations.
JWT=$(curl -sL "<https://api.thisismatter.com/elements/v1/auth/user_token>" -H "Authorization: Bearer $API_KEY" | jq -r ".token")

# Define a composition
# This sample is composed of four identities, with a total allocation of about 98853 DKK
SAMPLE_COMPOSITION='
{
  "composition": {
    "ids": [
      {
        "id": "lp6840f2174",
        "type": "uid",
        "allocation": {
          "amount": 1500,
          "currency": "EUR"
        }
      },
      {
        "id": "lp68w454263",
        "type": "uid",
        "allocation": {
          "amount": 20000,
          "currency": "DKK"
        }
      },
      {
        "id": "2eb7k.de",
        "type": "uid",
        "allocation": {
          "amount": 54112,
          "currency": "DKK"
        }
      },
      {
        "id": "ieevd.de",
        "type": "uid",
        "allocation": {
          "amount": 13582,
          "currency": "DKK"
        }
      }
    ]
  },
  "include": {
    "portfolio": {
      "impact": true
    }
  }
}'

# Calculate impact
curl -sL -XPOST "<https://api.thisismatter.com/elements/v1/portfolio/get>" \\
  -H "Authorization: Bearer $JWT" \\
  --data "$SAMPLE_COMPOSITION"