To replace the content of Text elements via API, use 【PUT】/entities/{eid}/attachment.
Example using Swagger:
- Prepare the Text file for replacement
- Open the Text element to be replaced and obtain the eid from the URL *1
- Using an administrator account, navigate to "App Launcher > Signals Configuration > System Settings > API Key"
- Click "Open External API Document"
- Expand "Entities"
- Expand "PUT /entities/{eid}/attachment"
- Click "Try it out"
- Enter the following parameters:
- eid: The eid obtained in Step 2
- Force: true*2
- Set Request body to "text/plain"*3 and select the Text file prepared in Step 1 using "Choose File"
- Click "Execute"
Notes:
*1 When opening a Text element, the URL will look like this: "<tenant URL>/elements/entity/text:..."
The eid is the string starting from "text:"
Example: If the URL shows ".../entity/text:77d5f307-6be0-446e-b30b-a3a814df6a78", then "text:77d5f307-6be0-446e-b30b-a3a814df6a78" is the eid.
*2 When setting a digest, do not set Force to True; instead, enter a value in the digest field.
*3 If the Text file prepared in Step 1 contains HTML elements, select text/html.
*The administrator account used to open Swagger in Step 3 must have Write or Full Control permissions for the Experiment containing the Text element opened in Step 2.
*This API replaces the entire content of the Text element rather than updating it.
Comments
0 comments
Article is closed for comments.