Skip to content
TOZADE
Country: Gabon
Language: English

Vendor API

Access to the vendor API of the application server, the main requests, publishing a version through git and the release request.

The vendor API is the /v1/vendor/* requests of the application server apps.tozade.ru. The application server has no vendor accounts; access is by token. The answer is JSON: the data field on success, the error field with code and message on failure. The request rate is limited: when it is exceeded the answer is RATE_LIMITED with retry_after.

Access

  1. The client address must be in the vendor allow_ips. Otherwise the answer is IP_NOT_ALLOWED. An empty list switches the API off for the vendor.
  2. The header Authorization: Bearer <token>. The token is issued in the developer account on the site and shown once; the server stores only its SHA-256.
  3. The vendor must be active, otherwise VENDOR_BLOCKED.

Requests

RequestWhat it does
GET /v1/vendorThe vendor profile.
GET /v1/vendor/keysThe vendor keys, their bindings and the replacement log.
POST /v1/vendor/keysRegister a key: fields algorithm, public_key, replaces, see release signature.
GET /v1/vendor/appsThe vendor applications; optional filter product.
POST /v1/vendor/appsCreate an application in your namespace: fields product and code. A current vendor key is required.
PATCH /v1/vendor/apps/{code}Show the application in the catalog or hide it: status is listed or unlisted.
POST /v1/vendor/apps/{code}/release-requestsA release request: field version, a version tagged on the test branch.
GET /v1/vendor/apps/{code}/release-requestsThe application requests; filter status: open, approved, rejected, withdrawn.
GET /v1/vendor/apps/{code}/release-requests/{id}A request: its state and the reason for rejection.
POST /v1/vendor/apps/{code}/release-requests/{id}/withdrawWithdraw an open request before the decision.
GET /v1/vendor/apps/{code}/versionsThe application versions and their states.
GET /v1/vendor/apps/{code}/versions/{version}A version: its state and transition history.
PATCH /v1/vendor/apps/{code}/versions/{version}max_product_version (narrowing only) and changelog per language ru and en (markdown).
POST /v1/vendor/apps/{code}/versions/{version}/unpublishUnpublish a version; the field reason is required.
POST /v1/vendor/apps/{code}/versions/{version}/publishReturn an unpublished version; one unpublished by the administrator cannot be returned (UNPUBLISHED_BY_ADMIN).

Publishing through git

An application is the git repository https://apps.tozade.ru/git/crm/<namespace>/<code>.git. Anyone can read it; pushing is over HTTPS only: the login is the namespace, the password is the vendor token (the same allow_ips, vendor status and rate limit as for the API). Creating the application with a request is optional: the first push registers it as a draft. Without a current vendor key the push is rejected (VENDOR_KEY_REQUIRED).

  1. Sign the version: raise version in manifest.yml and run app-hashes.sh, see release signature.
  2. Commit together with sig/ and send only the test branch: git push origin test. The push is a fast-forward; tags, deletion, force push and a direct push to release are rejected.
  3. The server checks the whole push and sets the version tag itself from the manifest version. The reason for a rejection is printed in git push.
  4. File a release request: POST /v1/vendor/apps/{code}/release-requests with the field version.
  5. The moderator approves the request: the server moves the version to release and publishes it in the catalog. After a rejection fix the application and release a new version with a greater number.

Versions

  • The number is MAJOR.MINOR.PATCH, each number at most 9 digits, no pre-releases.
  • On test a version is strictly greater than all earlier tags: an equal or lower one is rejected. Every push to test is a new version.
  • In a request the version is strictly greater than the version in release, otherwise VERSION_OLDER.
  • Versions are immutable: a number is never reused, a fix comes out under a new, greater number.

Release request

  • test is the working branch and does not reach the catalog. release holds what is released: only the moderator moves a version into it, on a request.
  • Request states: open, then approved or rejected (the moderator decides) or withdrawn (withdrawn by the vendor before the decision).
  • Checks on a request: the version tag is on a commit of the test branch, the hash list and signature are valid, release is an ancestor of the commit, min_product_version is in the list of product versions, there is no other open request for the version, the application is not blocked.
  • The moderator works through /v1/moderation/release-requests (token apm_…): the list, viewing the hash list and changed files, approve and reject with a required reason. These requests are not available to the vendor.

Request errors

CodeWhen
PACKAGE_INVALIDThe hash list, the fingerprint or the contents of sig/, or the version contents (manifest, locales, types, icon) failed the check; the reason is in message.
RELEASE_SIGNATURE_INVALIDThe hash list signature does not match the current vendor key.
KEY_RETIREDThe vendor key was replaced between the check of the request and its approval; the request will be checked again.
VERSION_OLDERThe request version is not greater than the version in release.
VERSION_EXISTSThe number is already in release, in the catalog under another commit, or has an open request.
VERSION_STATE_INVALIDThe version is not from the test branch, release is not an ancestor of its commit, the tag is on another commit, or the version state transition is not allowed.
PRODUCT_VERSION_UNKNOWNmin_product_version or max_product_version is not in the list of product versions.
VENDOR_KEY_REQUIREDThe vendor has no current key: register a key first.
APP_BLOCKED_BY_ADMINThe application or version is blocked by the administrator.

This site uses cookies: sign-in and the choice of country, language and theme rely on them. Cookie Policy