Skip to content

Importing as Campaign ​

API Type

PWA Backend API - Uses access keys in X-Albumstory header. See Authentication.

Import events as a Campaign with the PWA Dashboard, that would subsequently automate the generation of photobooks for the users within the event.

Environment URLs:

  • Development: https://pwa-api-dev.photobook.ai/v2/*
  • Production: https://pwa-api.photobook.ai/v2/*

Import via an API ​

🚧 Work-in-progress

This implementation method is not complete

Endpoint ​

POST https://pwa-api{-env}.photobook.ai/v2/campaign/auto-generate

Authentication ​

See Authentication - PWA Backend

Request Parameters ​

json
{
  "csvUrl": "https://path.to/csv.csv"
}
ParameterTypeRequiredDescription
csvUrlstringYesthe URL to reach the CSV file for download

Response ​

json
{
  "message": "processing automated generation for {{csvUrl}}"
}
FieldTypeDescription
messagestringA simple response message

Webhook (when a project URL is ready) ​

🚧 Work-in-progress

This implementation method is not complete

Endpoint ​

POST https://path.to/your-webhook-url

Authentication ​

This would be the client's authentication methods, if any, communicated with the PBAI team.

Request Parameters ​

json
{
  "protocol": "https",
  "hostname": "{frontend}.photobook.ai",
  "pathname": "",
  "query": {
    "id": "p-def",
    "clientId": "u-abc",
    "clientName": "theClientName",
    "user": "abcdefg",
    "product": true,
    "marketId": 0,
    "language": "en",
    "sku": "pb-8x8-hc",
    "psp": "demo"
  },
  "url": "https://{frontend}.photobook.ai?id=p-def&clientId=u-abc&clientName=theClientName&user=abcdefg&product=true&marketId=0&language=en&sku=pb-8x8-hc&psp=demo",
  "reference": "abcdefg"
}
ParameterTypeRequiredDescription
urlstringYesthe PWA Editor project URL to edit the book
referencestringYesa unique identifier reference value gleaned from the CSV, used to identify the user from the client's end, like a PIN

Response ​

A 200 status response is expected. The PWA Backend will attempt to retry an additional 3 more times on failures.

Implementation Guide ​

1. Gather Required Data ​

Before calling this API, you likely need:

  • Pre-generate the CSV for download
  • If there is authentication needed for the PWA Backend to download the CSV, do provide the credentials and method
  • Additionally, for the photo assets defined in the CSV, whether there is authentication needed
  • Any other configurable properties to communicate with the PBAI team, for example, the webhook/callback URL and methods when a book for an end-user is ready

2. Call the API ​

As described above

3. Handle the Webhook Callback ​

â„šī¸ This would be your API that PWA Backend would call

As described above

photobook.ai Developer Documentation