{"Status":true,"Message":"","Response":{"post":{"postuid":"cbe7f638-05cd-49f8-adc1-804d790496bc","tenantuid":"d8b744fc-2e70-4089-bb80-dd1d08f6c7b2","projectuid":"542e5f51-33cf-401f-aebe-4324ebe36fe4","title":"Basic Integration Pattern","slug":"docs/basic-integration-pattern","html":"\u003Cp\u003EFor partners that want to integrate with DailyStory, but don\u0027t have an API, we recommend using the following pattern for building a simple API that DailyStory can consume.\u003C/p\u003E\u003Ch2 id=\u0022authorizationa_hrefhttpsdevdailystorycomdocsbasicintegrationpatternauthorizationa\u0022\u003EAuthorization\u003Ca href=\u0022https://dev.dailystory.com/docs/basic-integration-pattern#authorization\u0022\u003E\u003C/a\u003E\u003C/h2\u003E\u003Cp\u003EWe recommend supporting either basic authentication using an Authorization header or Bearer authorization.\u003C/p\u003E\u003Ch2 id=\u0022data_typesa_hrefhttpsdevdailystorycomdocsbasicintegrationpatterndatatypesa\u0022\u003EData Types\u003Ca href=\u0022https://dev.dailystory.com/docs/basic-integration-pattern#data-types\u0022\u003E\u003C/a\u003E\u003C/h2\u003E\u003Cp\u003EDailyStory can handle any data type and we recommend using standard formats when serializing objects to JSON.\u003C/p\u003E\u003Cp\u003EThe only nuanced data type is datetime fields. Our preferred datetime format is to include the offset to allow our system to know the time zone the data is relative to. For example:\u0026nbsp;\u003Ccode\u003E2021-01-23T16:33:37-06:00\u003C/code\u003E.\u003C/p\u003E\u003Ch2 id=\u0022error_handlinga_hrefhttpsdevdailystorycomdocsbasicintegrationpatternerrorhandlinga\u0022\u003EError Handling\u003Ca href=\u0022https://dev.dailystory.com/docs/basic-integration-pattern#error-handling\u0022\u003E\u003C/a\u003E\u003C/h2\u003E\u003Cp\u003EWe recommend sending standard HTTP errors along with a JSON message.\u003C/p\u003E\u003Cp\u003EFor example if a customer record was not found for:\u0026nbsp;\u003Ccode\u003EGET /api/v1/customer/244988\u003C/code\u003E\u0026nbsp;we would ideally receive an HTTP 4XX error with the following body:\u003C/p\u003E\u003Cdiv class=\u0022code_wrapper\u0022\u003E\u003Cdiv class=\u0022code\u0022 data-language=\u0022json\u0022\u003E{\r\n\t\u0026quot;error\u0026quot;: \u0026quot;No customer found for id 244988\u0026quot;\r\n}\u003C/div\u003E\u003C/div\u003E\u003Ch2 id=\u0022end_pointsa_hrefhttpsdevdailystorycomdocsbasicintegrationpatternendpointsa\u0022\u003EEnd Points\u003Ca href=\u0022https://dev.dailystory.com/docs/basic-integration-pattern#end-points\u0022\u003E\u003C/a\u003E\u003C/h2\u003E\u003Cp\u003EWe generally recommend supporting at least 2 RESTful endpoints:\u003C/p\u003E\u003Cul\u003E\u003Cli\u003EGET Customer - retrieve a single customer record using the customer\u0027s unique identifier.\u003C/li\u003E\u003Cli\u003EGET Customers - retrieve a set of records based on a last updated timestamp.\u003C/li\u003E\u003C/ul\u003E\u003Ch2 id=\u0022data_to_includea_hrefhttpsdevdailystorycomdocsbasicintegrationpatterndatatoincludea\u0022\u003EData to Include\u003Ca href=\u0022https://dev.dailystory.com/docs/basic-integration-pattern#data-to-include\u0022\u003E\u003C/a\u003E\u003C/h2\u003E\u003Cp\u003EWe recommend including as much data as possible, but always recommend including standard fields such as:\u003C/p\u003E\u003Cul\u003E\u003Cli\u003EFirst name\u003C/li\u003E\u003Cli\u003ELast name\u003C/li\u003E\u003Cli\u003EEmail address\u003C/li\u003E\u003Cli\u003EMobile phone\u003C/li\u003E\u003Cli\u003ECity\u003C/li\u003E\u003Cli\u003EState\u003C/li\u003E\u003Cli\u003ECountry\u003C/li\u003E\u003C/ul\u003E\u003Cp\u003EAny unique data, such as categories, last purchase date, last order date, date shipped, etc. should also be included. DailyStory will allow customers to build segments based on this data.\u003C/p\u003E\u003Cp\u003EFor example, a segment of customers that has spent more than $N. Or, customers that haven\u0027t shopped in the past N days.\u003C/p\u003E\u003Ch2 id=\u0022get_customera_hrefhttpsdevdailystorycomdocsbasicintegrationpatterngetcustomera\u0022\u003EGet Customer\u003Ca href=\u0022https://dev.dailystory.com/docs/basic-integration-pattern#get-customer\u0022\u003E\u003C/a\u003E\u003C/h2\u003E\u003Cp\u003EThe Get Customer endpoint should allow for a single record to be retrieved based on your unique customer id. This endpoint is used for resyncing records or verifying that a synced record is correct.\u003C/p\u003E\u003Cp\u003EFor example:\u0026nbsp;\u003Ccode\u003EGET /api/v1/customer/{unique id}\u003C/code\u003E\u0026nbsp;might return:\u003C/p\u003E\u003Cdiv class=\u0022code_wrapper\u0022\u003E\u003Cdiv class=\u0022code\u0022 data-language=\u0022json\u0022\u003E{\r\n\t\u0026quot;id\u0026quot;: 244988,\r\n\t\u0026quot;first_name\u0026quot;: \u0026quot;Amanda\u0026quot;,\r\n\t\u0026quot;last_name\u0026quot;: \u0026quot;Grover\u0026quot;,\r\n\t\u0026quot;mobile_phone\u0026quot;: \u0026quot;5553728048\u0026quot;,\r\n\t\u0026quot;email\u0026quot;: \u0026quot;amanda.grover@example.com\u0026quot;,\r\n\t\u0026quot;points\u0026quot;: 322,\r\n\t\u0026quot;allow_sms\u0026quot;: true,\r\n\t\u0026quot;allow_email\u0026quot;: false,\r\n\t\u0026quot;city\u0026quot;: \u0026quot;Seattle\u0026quot;,\r\n\t\u0026quot;state\u0026quot;: \u0026quot;Washington\u0026quot;,\r\n\t\u0026quot;address\u0026quot;: null,\r\n\t\u0026quot;zip\u0026quot;: null,\r\n\t\u0026quot;birth_date\u0026quot;: null,\r\n\t\u0026quot;store_id\u0026quot;: 598,\r\n\t\u0026quot;total_orders\u0026quot;: 65,\r\n\t\u0026quot;total_sales\u0026quot;: 4118.01,\r\n\t\u0026quot;date_first_order\u0026quot;: \u0026quot;2021-01-23T16:33:37-06:00\u0026quot;,\r\n\t\u0026quot;date_last_order\u0026quot;: \u0026quot;2021-10-06T13:01:27-05:00\u0026quot;,\r\n\t\u0026quot;last_order_value\u0026quot;: 30.68,\r\n\t\u0026quot;categories\u0026quot;: [\r\n\t\t\u0026quot;Beauty \u0026quot;,\r\n\t\t\u0026quot;Health\u0026quot;\r\n\t]\r\n}\u003C/div\u003E\u003C/div\u003E\u003Ch2 id=\u0022get_customersa_hrefhttpsdevdailystorycomdocsbasicintegrationpatterngetcustomersa\u0022\u003EGet Customers\u003Ca href=\u0022https://dev.dailystory.com/docs/basic-integration-pattern#get-customers\u0022\u003E\u003C/a\u003E\u003C/h2\u003E\u003Cp\u003EThe Get Customers endpoint should return a paged list of records filtered by the a last updated timestamp. This allows DailyStory to make a request for all records since a point in time, typically since the last sync was run.\u003C/p\u003E\u003Cp\u003EFor example:\u0026nbsp;\u003Ccode\u003EGET /api/v1/customers?last_updated=2022-07-03T12:33:45\u003C/code\u003E\u0026nbsp;might return:\u003C/p\u003E\u003Cdiv class=\u0022code_wrapper\u0022\u003E\u003Cdiv class=\u0022code\u0022 data-language=\u0022json\u0022\u003E{\r\n\t\u0026quot;count\u0026quot;: 6692,\r\n\t\u0026quot;start\u0026quot;: \u0026quot;0\u0026quot;,\r\n\t\u0026quot;limit\u0026quot;: \u0026quot;25\u0026quot;,\r\n\t\u0026quot;records\u0026quot;: [{\r\n\t\t\t// record #1 --- see above example for record definition\r\n\t\t},\r\n\t\t{\r\n\t\t\t// additional records 2 - 25 in set not shown\r\n\t\t}\r\n\t]\r\n}\u003C/div\u003E\u003C/div\u003E","publish_status":0,"post_type":"Article","featured_image_updating":false,"meta_description":"Easily integrate with DailyStory by building a simple API. Learn recommended patterns for endpoints, authentication, data formats, and error handling.","display_toc":true,"has_workingcopy":false,"allow_indexing":true,"total_views":1088,"date_published":"2025-09-24T14:40:07.363","date_updated":"2025-09-24T14:40:08.373","date_created":"2025-09-24T14:39:02.36"}}}