Creation Profile aware D2 import via D2-REST API using d2-object-creation

Options

Hi,

I am trying to create an object via the d2 rest api and import content while honoring the selected creation profile which knows about the required fields, hidden fields and validations etc as well as where to autofile the content.

I'm still in postman at this point and can't get it to work correctly - I can create the object but unsure how to attach the content.

Was given an internal quick reference from support, but it is too vague and mentions no autolinking, so not useful.


1. Get the list of D2 import profiles 

http://<ip>:8080/d2sv/repositories/d2repo/d2-creation-profiles?mode=import&inline=true

2. Get the list of D2 Import Profile value configs for a selected profile.

http://<ip>:8080/d2sv/repositories/d2repo/d2-configurations/creationprofiles/080015fa80017510/value-configs?mode=import&inline=true

3. Get the Creation Properties page. Customer can skip this call if they don’t want any

default values or inherited values populated in the properties page

http://ip:8080/d2sv/repositories/d2repo/d2-creation-properties-page?profileid=080015fa80017510&profile-value-config-id=080015fa80017513&inline=true&filename=perfsearch.txt&mode=import

4. Create the object (Only the properties NOT the content). Object would get created in

the user’s default cabinet

http://ip:8080/d2sv/repositories/d2repo/d2-object-creation?profileid=080015fa80017510&profile-value-config-id=080015fa80017513&mode=import

5. Get the object content upload URL. Specify link-id here incase you would like object to

be created in a specified folder. Make sure there is no “Autolinking” configured in D2

Config. 

http://ip:8080/d2sv/repositories/d2repo/objects/090015fa800276dc/d2-content-uploadurls?content-size=581&link-id=0b0015fa80015893&format=crtext&inline=true&linkid=0b0015fa80015893

6. Call SetFile link returned in the response of step5. This call would set the content to

the object created in step4. This call would also move the object from user’s cabinet

to the folder specified by link-id in step5. 

Tagged: