Skip to content
Aller au contenu
Charitips

API reference · Files

Create a file generation request

POST/v1/files/file-generation-requests

Request the generation of a file. The request will be queued and processed asynchronously. ⚠️ This endpoint is rate limited.

Requires a Bearer access token.

Body

CreateFileGenerationRequestDto

1 of 2 fields has no description in the spec.

  • type#stringrequired

    PRINT_PHYSICAL_CARDS_PDF

  • params#FileGenerationRequestParamsrequired

    File generation request parameters. For PRINT_PHYSICAL_CARDS_PDF, campaignId is required.

    2 child fields
    • fileRefsstring[]

    • campaignIdstringUUID

Response

200 · FileGenerationRequest

No field is described in the spec.

  • fileGenerationRequestId#stringalways returned

  • hash#stringalways returned

  • slug#stringalways returned

  • type#FileGenerationTypealways returned

    ZIPPRINT_PHYSICAL_CARDS_PDF

  • status#FileGenerationStatusalways returned

    PENDINGDONEFAILED

  • accountId#string

  • userId#string

  • charityId#string

  • charityUserId#string

  • createdAt#string (date-time)always returned

  • updatedAt#string (date-time)always returned

Errors

  • 400Missing params in createFileGenerationRequest
    {
      "statusCode": 400,
      "message": "Missing params in createFileGenerationRequest",
      "error": "Bad Request"
    }
  • 400A field is missing, has the wrong type, or is not part of the request schema.

    Every request with a body or query is validated.

    {
      "statusCode": 400,
      "message": [
        "amount must not be less than 1",
        "property foo should not exist"
      ],
      "error": "Bad Request"
    }
  • 401Unauthorized

    Missing, expired or invalid access token.

    {
      "statusCode": 401,
      "message": "Unauthorized"
    }
  • 403Account closed
    {
      "message": "Account closed",
      "code": "ACCOUNT_CLOSED"
    }
  • 429Rate limit exceeded

    Too many calls to this endpoint in a short time.

    {
      "statusCode": 429,
      "message": "Rate limit exceeded"
    }
POST /v1/files/file-generation-requests
curl -X POST https://api.sandbox.charitips.com/v1/files/file-generation-requests \  -H "Authorization: Bearer $CHARITIPS_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "type": "PRINT_PHYSICAL_CARDS_PDF",    "params": {      "campaignId": "<campaignId>"    }  }'
Built from the spec and the API code

Request bodies are written for this docs and checked against the API's validation; ids in angle brackets are placeholders. Response values are placeholders built from the schema.