Upload Item to Repository

Uploads an item to the Perfecto repository.

URL

Copy
https://<your-cloud>.app.perfectomobile.com/repository/api/v1/artifacts

Method

POST

Header parameters

Name

Description

Perfecto-Authorization

Security Token

Query parameters

The request should have a content type of multipart/form-data. The first part key is inputStream, with a content type of application/octet-stream. The second part key is requestPart with a content type of application/json.

Parameter Description

inputStream

The repository item itself

requestPart

Contains the metadata of the repository item to be uploaded. 

  • artifactLocatorUnique artifact identifier.

    Format: {folderType}:{artifactKey}

    where:

    • folderType: Defines privileges of accessibility. Possible values:

      • PRIVATE: Only the owner has access to the artifact.

      • GROUP: Only users related to the owner’s group will have access to the artifact.

      • PUBLIC: All users have access to the artifact.

    • artifactKey: Unique identifier of the artifact.

    The artifactKey cannot contain backslash (\) characters. If no artifactName is provided, artifactKey cannot contain any of the following characters: /\:"*?<>|”

  • artifactTypeOptional. Defines the artifact type. Can have one of the following values:

    • GENERAL

    • IOS

    • SIMULATOR

    • ANDROID

    • IMAGE

    • AUDIO

    • VIDEO

    • SCRIPT

  • artifactName: Optional. Used for the representation of the artifact when downloaded. Default value is artifactKey.

    The artifactName cannot contain any of the following characters: /\:"*?<>|”

  • mimeType: Optional. Defines contentType.

  • override: Optional. Whether to override if an artifact with the same artifactLocator exists. Default value is false.

tags

Adds one or more tags to a file uploaded to the repository. The tags are defined as a list. For example: ["tag1", "tag2"]

cURL

Copy
Windows (command prompt)
curl --location "https://CLOUD_NAME.app.perfectomobile.com/repository/api/v1/artifacts" --header "Perfecto-Authorization: YOUR_PERFECTO_TOKEN" --form "inputStream=@\"C:\\tmp\\Test_APK_Version.apk\"" --form "requestPart=\"{\\\"artifactLocator\\\":\\\"PRIVATE:Test_APK_Version2.apk\\\", \\\"tags\\\":[\\\"test\\\"], \\\"mimeType\\\":\\\"multipart/form-data\\\", \\\"override\\\": true, \\\"artifactType\\\": \\\"ANDROID\\\"}\""
Copy
Mac/Linux
curl --location 'https://CLOUD_NAME.app.perfectomobile.com/repository/api/v1/artifacts' \
--header 'Perfecto-Authorization: YOUR_PERFECTO_TOKEN' \
--form 'inputStream=@"/Users/rnagpure/Downloads/PerfectoLOGO.png"' \
--form 'requestPart="{\"artifactLocator\":\"PUBLIC:test_PerfectoLOGO.png\", \"tags\":[\"test\"], \"mimeType\":\"multipart/form-data\", \"override\": true, \"artifactType\": \"IMAGE\"}"'
Important: Specifying the artifactType metadata is mandatory when uploading files bigger than 143 MB.

artifactType metadata is case sensitive and should only be passed in uppercase letters.

Success response

Code: 200

Error response

Error code Reason

400 BAD REQUEST

The request included the wrong body content

401 UNAUTHORIZED

Wrong security token

409 CONFLICT

Override of an existing asset with the same locator fails because override is set to false

500 INTERNAL_SERVER_ERROR

Internal error