Documentation > Access API > AssetController > accessapi/Asset/Upload

accessapi/Asset/Upload

Create a new asset in the CMS the content of which will be the bytes supplied in req.

POST

https://cms.crownpeak.com/[Your Instance]/cpt_webservice/accessapi/Asset/Upload


Request Information

URI Parameters

None.

Body Parameters

The parameters sent as post data.

AssetUploadRequest

NameDescriptionType
bytes

System.Byte[]
destinationFolderId

System.Int32
modelId

System.Int32
newName

System.String
workflowId

System.Int32

Request Formats

application/json

Sample:

            
            {
              "newName": "test upload file",
              "destinationFolderId": 0,
              "modelId": 2263,
              "workflowId": 0,
              "bytes": "SGVsbG8sIHdvcmxk"
            }
            
            



Response Information

Resource Description

AssetUploadResponse

NameDescriptionType
asset

CrownPeakApp.Model.WorklistAsset
displayUrl

System.String
ResultCode

eResultCodes
ErrorMessage

System.String
InternalCode

System.Int32
IsSuccessful

System.Boolean

Response Formats

application/json

Sample:

            
            {
              "asset": {
                "fullPath": null,
                "iconType": "Asset",
                "isFlagged": false,
                "iconTypeValue": null,
                "isWcoIntegrated": false,
                "permissionList": "0100011111100101110011100000100010001011000100001110000000000110000000011100000111000000000000000001000000",
                "hasCSharpInput": false,
                "id": 8422,
                "taskCount": 0,
                "error_code": 0,
                "branchId": -2,
                "label": "test upload file",
                "type": 2,
                "folder_id": 0,
                "workflow_id": 11,
                "workflow_step": 1,
                "version_id": null,
                "status_user_id": 11,
                "status": 780,
                "status_date": "2014-10-29T12:42:38.42",
                "owner_user_id": 0,
                "creator_user_id": 11,
                "storage_id": 246,
                "extension": "",
                "create_date": "2014-10-29T12:42:38.42",
                "modified_user_id": 11,
                "modified_date": "2014-10-29T12:42:38.42",
                "checkout_user_id": null,
                "checkout_date": null,
                "error_msg": null,
                "size": 12,
                "template_id": 0,
                "template_label": null,
                "acl_id": 961,
                "change_date": "2014-10-29T12:42:39",
                "change_user_id": 11,
                "child_id": 8422,
                "base_model_id": 2263,
                "model_id": null,
                "deploy_id": 0,
                "is_deleted": null,
                "is_hidden": null,
                "publish_date": null,
                "publish_user_id": null,
                "template_language": 0,
                "subtype": null,
                "statusName": "Draft",
                "statusColor": "8DBEDA",
                "ownedBy": null,
                "createdBy": "CrownPeak Admin",
                "modifiedBy": "CrownPeak Admin",
                "lastPublishedBy": null,
                "statusChangedBy": "CrownPeak Admin",
                "changedBy": "CrownPeak Admin",
                "checkedOutBy": null,
                "templateSubType": null,
                "isQueued": false,
                "hasPeriodicSchedule": false,
                "hasWorkflowSchedule": false,
                "approvedWorkflowFilters": [
                  33
                ]
              },
              "displayUrl": "/AdventGeneral",
              "resultCode": "conWS_Success",
              "errorMessage": "",
              "internalCode": 0
            }
            
            

Connect with Crownpeak