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

Data parameters (body)

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

    Note

    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.

    Note

    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.

Copy
inputStream InputStream    (FormDataParam)
    requestPart (FormDataParam)
    {
        "artifactLocator":""                        
        "artifactType": "",        
        "artifactName": "",
        "mimeType": ""        "override": "",
    }

cURL

Copy
curl "https://CLOUD_NAME.app.perfectomobile.com/repository/api/v1/artifacts" -H "Perfecto-Authorization: YOUR_PERFECTO_TOKEN" -H "Content-Type: multipart/form-data" -F "requestPart={\"artifactLocator\":\"PRIVATE:app.apk\",\"artifactType\":\"ANDROID\",\"override\":true}" -F "inputStream=@/path/to/app.apk"
Note
  • Specifying the artifactType metadata is mandatory when uploading files bigger than 143 MB.

  • artifactType metadata is case sensitive and should only be passed only 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