# Package cURL config into an app

**URL:** <https://community.dynatrace.com/t/package-curl-config-into-an-app/46353>\
**Category:** Developer Q&A Forum\
**Tags:** custom-app\
**Created:** [June 27, 2024, 10:15pm UTC](https://community.dynatrace.com/t/package-curl-config-into-an-app/46353 "2024-06-27T22:15:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam\_gardner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/adam_gardner/32/20087_2.png) [@adam\_gardner](https://community.dynatrace.com/u/adam_gardner)\
**Post date:** [June 27, 2024, 10:15pm UTC](https://community.dynatrace.com/t/package-curl-config-into-an-app/46353/1 "2024-06-27T22:15:53Z")

</div>

```markup
# Capture OpenTelemetry Span Attributes

curl -X 'POST' \
  "https://{environmentid}.live.dynatrace.com/api/v2/settings/objects?validateOnly=false" \
  -H 'accept: application/json; charset=utf-8' \
  -H "Authorization: Api-Token $DT_WRITE_SETTINGS_TOKEN" \
  -H 'Content-Type: application/json; charset=utf-8' \
  -d '[{ "schemaId": "builtin:attribute-allow-list", "schemaVersion": "0.0.10", "scope": "environment", "value": { "enabled": true, "key": "gen_ai.request.model" } }, { "schemaId": "builtin:attribute-allow-list", "schemaVersion": "0.0.10", "scope": "environment", "value": { "enabled": true, "key": "gen_ai.system" } }]'

```

I have this cURL command that I ultimately want to “wrap” into an app and list on the hub. In this way, my users can configure all span attributes in a one-click way.

How do I achieve this? Rework this as Terraform / Monaco and package that way? Python?

If you have any docs, that’d be much appreciated.

---

<div class="post-metadata">

**Author:** ![Dant3](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dant3/32/159_2.png) [@Dant3](https://community.dynatrace.com/u/Dant3)\
**Post date:** [June 28, 2024, 1:10am UTC](https://community.dynatrace.com/t/package-curl-config-into-an-app/46353/2 "2024-06-28T01:10:18Z")

</div>

I have done something similar, for the DocumentService.

Expose a Function in the app that would work as middleware to the environment API&nbsp;[settingsObject](https://developer.dynatrace.com/reference/sdks/client-classic-environment-v2/#postsettingsobjects)&nbsp; that would take payload and pass that to the API2 via the SDK. You need only to map the payload with the body of the request.

[AFIK a Function is the only way to pass input](https://developer.dynatrace.com/develop/functions/pass-input/) &nbsp;and also have more freedom with packages.

If you dont require input from the user, just make the function to do the call with the information hardcoded.

```javascript
import { settingsObjectsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await settingsObjectsClient.postSettingsObjects({
    body: [
      {
        schemaId:
          "builtin:container.built-in-monitoring-rule",
        scope: "HOST-D3A3C5A146830A79",
        value: {},
      },
    ],
  });

```
