Skip to content
Docs menu

Copy the text

Your browser did not allow copying. The text below is selected: press Ctrl+C, or ⌘C on a Mac.

Rate a conversion

Good or bad, with optional reasons. Rating again replaces the earlier rating. The file itself is not kept for the rating.

POSThttps://api.switchfile.io/v1/conversions/{id}/rating

Needs an API key: Authorization: Bearer YOUR_API_KEY. See Authentication.

Example

curl "https://api.switchfile.io/v1/conversions/0b8a7c1e-5d0f-4a51-9f39-2f7f4c1d9a10/rating" \
  -H "Authorization: Bearer $SWITCHFILE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "good": false,
    "reasons": [
      "layout"
    ]
  }'

Parameters

Path parameters

  • idstring (uuid)required

    ID of the conversion

Request body

  • goodbooleanrequired
  • reasonsstring[]

    Short keys like layout or text, or failed:<error code>

    at most 10 items

Responses

  • 200OK
    • conversion_idstring (uuid)required
    • goodbooleanrequired
    • idstring (uuid)required
    • reasonsstring[]required
    200 application/json
    {
      "id": "4d2c9a7e-1f3b-4e8a-9c6d-5b0a7f2e1c3d",
      "conversion_id": "0b8a7c1e-5d0f-4a51-9f39-2f7f4c1d9a10",
      "good": false,
      "reasons": [
        "layout"
      ]
    }
  • 401The API key is missing or not valid
    401 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-unauthenticated",
      "title": "Unauthenticated",
      "status": 401,
      "code": "UNAUTHENTICATED",
      "detail": "Missing or invalid API key."
    }
  • 403Not available without an account, or with a connected app
    403 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-sign-in-required",
      "title": "Sign in required",
      "status": 403,
      "code": "SIGN_IN_REQUIRED",
      "detail": "Sign in to use this."
    }
  • 404Does not exist for this account
    404 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-not-found",
      "title": "Not found",
      "status": 404,
      "code": "NOT_FOUND",
      "detail": "Conversion not found."
    }
  • 409The conversion is still running
    409 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-conversion-not-finished",
      "title": "Conversion not finished",
      "status": 409,
      "code": "CONVERSION_NOT_FINISHED",
      "detail": "Rate the conversion once it has finished."
    }
  • 422Invalid data. errors names the fields
    422 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-invalid-data",
      "title": "Invalid data",
      "status": 422,
      "code": "INVALID_DATA",
      "detail": "The request contains invalid data.",
      "errors": {
        "to": [
          "Expected string"
        ]
      }
    }
  • 429Too many requests or a daily quota is used up. See Retry-After
    429 application/problem+json
    {
      "type": "https://switchfile.io/docs/api/v1#errors-rate-limit-exceeded",
      "title": "Rate limit exceeded",
      "status": 429,
      "code": "RATE_LIMIT_EXCEEDED",
      "detail": "Too many requests. Try again in 12 seconds."
    }

Error bodies and codes are explained in Errors.