Appearance
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-generateAuthentication â
See Authentication - PWA Backend
Request Parameters â
json
{
"csvUrl": "https://path.to/csv.csv"
}| Parameter | Type | Required | Description |
|---|---|---|---|
csvUrl | string | Yes | the URL to reach the CSV file for download |
Response â
json
{
"message": "processing automated generation for {{csvUrl}}"
}| Field | Type | Description |
|---|---|---|
message | string | A 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-urlAuthentication â
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"
}| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | the PWA Editor project URL to edit the book |
reference | string | Yes | a 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