Upload via Postman
Upload a raw package via the Cloudsmith APIs using Postman
In the following examples:
Identifier | Description |
---|---|
OWNER | Your Cloudsmith account name or organisation name (namespace) |
REPOSITORY | Your Cloudsmith Repository name (also called "slug") |
USERNAME | Your Cloudsmith username |
PASSWORD | Your Cloudsmith password |
API-KEY | Your Cloudsmith API Key |
PACKAGE_NAME | The name of your package |
PACKAGE_VERSION | The version number of your package |
Uploading a raw package to Cloudsmith via the URL is a 2 step process:
- A PUT req against the upload URL: https://upload.cloudsmith.io/OWNER/REPOSITORY/PACKAGE_NAME.
The response to this PUT req gives you an identifier that you will need for the next stage. - A POST req to https://help.cloudsmith.io/reference/packages_upload_raw
Postman is an application used for API testing. You can install Postman here
Lets see how you can upload a raw package using Postman:
PUT req against the upload URL
- Populate the PUT request URL https://upload.cloudsmith.io/CLOUDSMITH_ORG/CLOUDSMITH_REPO/PACKAGE_NAME
- Switch to the ‘Authorization’ tab and populate your credentials with either Basic Auth or your API Key
- Switch to the ‘Body’ tab and upload the file as a binary.
- Press send and receive the response.
- Read the identifier from the response to use in the next stage
POST Raw package
- Populate the request with the POST url: https://api-prd.cloudsmith.io/v1/packages/CLOUDSMITH_ORG/CLOUDSMITH_REPO/upload/raw/
- Select the ‘Body’ tab and populate it with your JSON (NOTE: the package_file value should be populated with the identifier from the PUT response above):
{"package_file": "IDENTIFIER", "name": "test-package", "description": "Everything about packaging files.", "summary": "My Package File", "version": "1.0"}
package_file value has to be the same as the response from the PUT req above- it is populated in the identifier value. - Switch to the ‘Authorization’ tab and populate your credentials with either Basic Auth or your API Key
- Press send to upload the raw package.
Updated 10 months ago