# :pizza: Dominos ###### tags: `whilter,customer` ## Use Case : Abandoned Cart - API ### Integration Mechanism - API Source IP need to be white list - Sunil please check API gateway ### New Video URL : https://api.whilter.ai/video Request : POST Header : API-KEY ### Request 1. **client-request-id :** Optional, if provided should be unique. 2. **client-id :** provided by whilter (Dominos identifier) 3. **template-id :** provided by whilter (specific to use case) 4. **user-id :** identifier for user and can be encrypted. Opaque to whilter. 5. **user-text :** Dynamic text array used in video. Closed while creating story board. 6. **product-image-ids :** list of product images in videos. It will have product ids and these will be mapped to image CDN urls 7. **product-videos-ids :** list of product videos that will be part of main videos. It will have product ids and these will be mapped to video CDN url ```json { "client-request-id" : "client-unique-key", "client-id": "<Client Id>", "template-id": "<template-uuid>", "user-id": "<user-id>", "user-text" : [ "User specific text 1", "User specific text 2" ], "image-ids" : [ "product-image-id-1", "product-image-id-2", "product-image-id-3", "product-image-id-4" ], "video-ids" : [ "product-video-id-1", "product-video-id-2", "product-video-id-3" ] } ``` ### Response 1. **client-request-id :** Client's request id. 2. **whilter-request-id :** Whilter generated id 3. **Status :** Status code of request #### Success - HTTP Code : 202 ```json { "client-request-id" : "client-unique-key", "whilter-request-id" : "whilter-uuid", "status" : "202" } ``` #### Failure - HTTP Code : 40X e.g.404 for wrong client or template id ```json { "request-identifier" : "client-unique-key", "status" : "40X" } ``` ## Video Status Client > If needed Whilter can call client API to update the status. This will trigger on success of video generation URL : https://api.whilter.ai/status?client-request-id={client-request-id} URL : https://api.whilter.ai/status?whilter-request-id={whilter-request-id} Request : GET Header : API-KEY ### Response #### Success - HTTP Code : 200 ```json { "client-request-id" : "client-unique-key", "whilter-request-id" : "whilter-uuid", "status" : "200", "state" : "success", "video-url" : "https://amplify-whilter-dev--193849-deployment.s3.ap-south-1.amazonaws.com/videos/final-video.mp4" } ``` #### In Process - HTTP Code : 200 ```json { "client-request-id" : "client-unique-key", "whilter-request-id" : "whilter-uuid", "status" : "200", "state" : "in-process" } ``` #### In Failure - HTTP Code : 404 e.g.404 for request id not found ```json { "request-identifier" : "client-unique-key", "status" : "404", "state" : "failure" } ``` ## Use Case : Year End Summary ### Integration Mechanism - CSV Whilter will provide link to S3 bucket. Customer will get credentials to access bucket. User will upload csv file. Whilter connectors will pick up file and generate one video for each row. #### Input CSV Exampl name = domino-23-dec.csv | Request id | Customer Data as Json | | ------------------------------------ | ------------------------------------------------------- | | 243d8f06-ed51-4e41-977f-adb29e02df7a | {"product-id" : "11", "quantity" : 4, "name" : "Rajan"} | | 3a7f4244-aa1e-435b-b551-38c3cdf3054f | {"product-id" : "45", "quantity" : 3, "name" : "Sunil"} | #### Output CSV There will be multiple CSV of 100k (configurable) records each Example names = output-domino-23-dec_1.csv, output-domino-23-dec_2.csv | Request id | Output Video. | | ------------------------------------ | ----------------------------------------------------------------------------------------- | | 243d8f06-ed51-4e41-977f-adb29e02df7a | "https://cdn.s3.ap-south-1.amazonaws.com/videos/243d8f06-ed51-4e41-977f-adb29e02df7a.mp4" | | 3a7f4244-aa1e-435b-b551-38c3cdf3054f | "https://cdn.s3.ap-south-1.amazonaws.com/videos/3a7f4244-aa1e-435b-b551-38c3cdf3054f.mp4" |