{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/api/v:version/osrs/:site_id/:identifier_type/:identifier","auth":"required","settings":"620f4ef3d05b89003c7d94df","examples":{"codes":[]},"method":"get","params":[{"name":"site_id","type":"string","default":"","desc":"Unique identifier for your Boomtrain site.","required":true,"in":"path","ref":"","_id":"56ccd19e94c8f00b00b83f42"},{"name":"identifier_type","type":"string","default":"","desc":"URL path parameter. Indicates the type of identifier used to identify the user. Currently-supported identifier types are `email`, `user_id`,  and `bsin`. A user's `bsin` can be obtained through the route documented at [Get a Boomtrain Identifier for a Person](https://boomtrain.readme.io/docs/get-a-boomtrain-identifier)","required":true,"in":"path","ref":"","_id":"56bd1626ac1c5c1900b2dbf2"},{"name":"identifier","type":"string","default":"","desc":"URL path parameter. Indicates the identifier for the user receiving recommendations.","required":true,"in":"path","ref":"","_id":"56e9a66b46bfd60e008840b1"},{"name":"pname","type":"string","default":"","desc":"Identifies the Placement name. It can be picked as is from the Website In Page Campaign UI without the need of removing spaces","required":true,"in":"query","ref":"","_id":"620f580b0857e6006426bdbc"},{"name":"test","type":"boolean","default":"false","desc":"URL query parameter. If true then don't record recommendations. Accepts any of `t`, `true`, `y`, `yes`, or `1` as true, all other values are treated as false. Note that this value should NOT be set unless you are testing recommendations pre-deployment.","required":false,"in":"query","ref":"","_id":"620f580b0857e6006426bdbd"}],"results":{"codes":[]}},"next":{"description":"","pages":[]},"title":"Website In-Page Campaign API","type":"endpoint","slug":"website-in-page-campaign-api","excerpt":"The Website In-Page Campaign API returns resources for a specified user based on the configured Placement logic.","body":"## Request\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl 'https://onsiterecs.api.boomtrain.com/api/v1/osrs/your_site/email/user:::at:::example.com?pname=your_placement_name&test=true'\",\n      \"language\": \"curl\",\n      \"name\": \"Using Email Address\"\n    },\n    {\n      \"code\": \"curl 'https://onsiterecs.api.boomtrain.com/api/v1/osrs/your_site/bsin/Lhzn0ClM1A397PINUa%2BzVSoh%2BH06noQl%2F9wNxvKWLa8jEsNFj58yKhA6bOoeDNG2S6TYsmkkj6u7xDdcOcp1tA%3D%3D?pname=your_placement_name&test=true'\",\n      \"language\": \"curl\",\n      \"name\": \"Using BSIN\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"When you're ready to deploy this endpoint, remove 'test=true' from the URL. Otherwise, user metrics will not be recorded.\",\n  \"title\": \"Please note:\"\n}\n[/block]\n## Results\n[block:code]\n{\n  \"codes\": [\n    {\n      \"name\": 200,\n      \"code\": \"[\\n    {\\n        \\\"selector\\\": \\\"\\\",\\n        \\\"placement\\\": \\\"replace\\\",\\n        \\\"view-pixel-url\\\": \\\"https://redirect.api.boomtrain.com/vp/site/MPYIlJ5wVbiAk/WKDz+eTt7tPvJn8diIBkjyf0PO9vEUSI155pgjju+XgdHpH0S8sVcrTntNZ2A1954wgyZ80A==?c=None&b=None&p=True&rt=None&rid=None&r=None&rsid=ae3ace96-e701-11e5-9ddd-12d5480515d7\\\",\\n        \\\"recs\\\": {\\n            \\\"sections\\\": {\\n                \\\"recs\\\": {\\n                    \\\"recs\\\": [\\n                        {\\n                            \\\"campaign_name\\\": \\\"Single Website Campaign\\\",\\n                            \\\"click-url\\\": \\\"https://redirect.api.boomtrain.com/click/application/abc?r=article:1234&c=None&b=None&rd=http://example.com\\\",\\n                            \\\"id\\\": \\\"39\\\",\\n                            \\\"is_personalized\\\": false,\\n                            \\\"props\\\": {\\n                                \\\"campaign_name\\\": \\\"Managing Your Money & Lifestyle\\\",\\n                                \\\"content\\\": \\\"carousel\\\",\\n                                \\\"description\\\": \\\"Cut down on holiday costs this year with these 7 shopping secrets. You don't have to skimp on your best holiday gift ideas with these quick shopping tips.\\\",\\n                                \\\"device\\\": \\\"Desktop, Mobile\\\",\\n                                \\\"experience\\\": \\\"Default\\\",\\n                                \\\"expiration_date\\\": \\\"2021-11-04T09:19:09.860000+00:00\\\",\\n                                \\\"pubDate\\\": \\\"2021-11-04T09:19:09.860000+00:00\\\",\\n                                \\\"resource-id\\\": \\\"39\\\",\\n                                \\\"scenario_name\\\": [\\n                                    \\\"Unknown\\\"\\n                                ],\\n                                \\\"thumbnail\\\": \\\"http://images.boomtrain.com/nPxlsbnUidapRiOPVDYew7h3gk1qo7m95OPmYdPe67Y.png\\\",\\n                                \\\"title\\\": \\\"7 Secrets to Shopping Smarter: Ways to Save Money on Holiday Gift Ideas\\\",\\n                                \\\"url\\\": \\\"http://example.com\\\"\\n                            },\\n                            \\\"rec-id\\\": \\\"264f5c00-6eb5-4a35-9cdd-dd828d412c49:Single Website Campaign!recs!user_interest:0\\\",\\n                            \\\"recset-id\\\": \\\"264f5c00-6eb5-4a35-9cdd-dd828d412c49\\\",\\n                            \\\"resource-type\\\": \\\"article\\\",\\n                            \\\"thumbnail\\\": \\\"http://images.boomtrain.com/nPxlsbnUidapRiOPVDYew7h3gk1qo7m95OPmYdPe67Y.png\\\"\\n                        },\\n                        {\\n                            \\\"campaign_name\\\": \\\"Single Website Campaign\\\",\\n                            \\\"click-url\\\": \\\"https://redirect.api.boomtrain.com/click/application/abc?r=article:0229&c=None&b=None&rd=http://example.com/2\\\",\\n                            \\\"id\\\": \\\"86\\\",\\n                            \\\"is_personalized\\\": false,\\n                            \\\"props\\\": {\\n                                \\\"campaign_name\\\": \\\"Market Outlook\\\",\\n                                \\\"content\\\": \\\"carousel\\\",\\n                                \\\"description\\\": \\\"The path to the U.S. presidency is a long and arduous one. With the U.S. election on November 3rd quickly approaching, uncertainty remains elevated.\\\",\\n                                \\\"device\\\": \\\"Desktop, Mobile\\\",\\n                                \\\"experience\\\": \\\"Default\\\",\\n                                \\\"expiration_date\\\": \\\"2021-11-04T09:22:20.255000+00:00\\\",\\n                                \\\"pubDate\\\": \\\"2021-11-04T09:22:20.255000+00:00\\\",\\n                                \\\"resource-id\\\": \\\"86\\\",\\n                                \\\"scenario_name\\\": [\\n                                    \\\"Unknown\\\"\\n                                ],\\n                                \\\"thumbnail\\\": \\\"http://images.boomtrain.com/EvA0Q1EjAgyK78AwUhzNqdq0WIt0oSXx6smKGv4hgc0.gif\\\",\\n                                \\\"title\\\": \\\"Washington Watch: The Path to the Presidency\\\",\\n                                \\\"url\\\": \\\"http://example.com/2\\\"\\n                            },\\n                            \\\"rec-id\\\": \\\"264f5c00-6eb5-4a35-9cdd-dd828d412c49:Single Website Campaign!recs!user_interest:1\\\",\\n                            \\\"recset-id\\\": \\\"264f5c00-6eb5-4a35-9cdd-dd828d412c49\\\",\\n                            \\\"resource-type\\\": \\\"article\\\",\\n                            \\\"thumbnail\\\": \\\"http://images.boomtrain.com/EvA0Q1EjAgyK78AwUhzNqdq0WIt0oSXx6smKGv4hgc0.gif\\\"\\n                        },                      \\n                    \\\"request_context\\\": \\\"user_interest\\\",\\n                    \\\"type\\\": \\\"popular\\\"\\n                }\\n            },\\n            \\\"view-pixel\\\": \\\"https://redirect.api.boomtrain.com/vp/site/MPYIlJ5wVbiAk/WKDz+eTt7tPvJn8diIBkjyf0PO9vEUSI155pgjju+XgdHpH0S8sVcrTntNZ2A1954wgyZ80A==?c=None&b=None&p=True&rt=None&rid=None&r=None&rsid=ae3ace96-e701-11e5-9ddd-12d5480515d7\\\"\\n        }\\n    }\\n]\",\n      \"language\": \"json\",\n      \"status\": 200\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<div>  \\n<h4>View Pixel Tracking</h4>\\nIn order to provide metrics and data to improve Boomtrain's recommendation systems, the `view-pixel` returned in the result of this call should be impressed whenever these results are viewed by a user. This can be done by adding an invisible image pixel into the HTML body where the request is being shown. For example, <span style='font-family:Consolas,Courier New,monospace'>&lt;img src=\\\"view-pixel returned by this route\\\" /&gt;</span>.\\n</div>\\n<style></style>\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Results\"\n}\n[/block]\nNote that the `view-pixel` should be rendered on each impression of a recommendation set in order to track views of recommendations.\n\nAs well, the `click-url` should be triggered upon click of any recommendation in order to track clicks for the purpose of evaluating performance.","updates":[],"order":18,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"620f4d239e2b200023d85947","createdAt":"2022-02-18T07:39:15.237Z","user":"620ca09c8d802700b3ebb8c8","category":{"sync":{"isSync":false,"url":""},"pages":["56d4ec8573dcd20b00fb876a"],"title":"Server-Side Integration REST API","slug":"authorization","order":3,"from_sync":false,"reference":true,"_id":"56d4ec4773dcd20b00fb8769","__v":1,"version":"56aff08c3a5b810d00745d9c","createdAt":"2016-03-01T01:11:35.547Z","project":"56aff08c3a5b810d00745d99"},"version":{"version":"1","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["56aff08d3a5b810d00745d9d","56aff24f3a5b810d00745da0","56aff25dbc304a0d00ace207","56aff287e0b1e40d00c53798","56aff2b260a37a0d00ed8883","56aff2b8e0b1e40d00c53799","56aff2bd5b1f01170014dc7b","56aff2c9d21e9c0d00b62993","56aff493aef9a21700da0e67","56aff4ce1486990d009c0f64","56aff4da5b1f01170014dc7d","56aff4dfe0b1e40d00c537a2","56aff4e59d32e30d0006d3e9","56aff4e91486990d009c0f65","56aff4f93a5b810d00745da2","56aff4fe9d32e30d0006d3ea","56b91c7ab1e03e0d001057c5","56c4f51aba4a540d0091b9a2","56cd09488c4a331d002c1e44","56d4ec4773dcd20b00fb8769","56e79bc515f96b2200878e54","56ec25c538ff1d2200d56cc2","56ec3a6f36bc8e0e00f190c8","56ec3e308ea7ce0e00a3d8b0","5724d8fe4255580e005938b2","5724dc842ad0bc1700122803","5776ef2a04f7500e0095dc37","57ab9f70b5e8742000e17eb9","57d7117646dcc30e007dd21f","58e6abd5b1eece19008b7d31","59288c65e2653627003e1221","5a8f4797a44f8600128e75ee","5bbf8833eb416300039a2c14","5ea811617bf4b5007328a0af","624322a1991d51047c8a5af9"],"_id":"56aff08c3a5b810d00745d9c","project":"56aff08c3a5b810d00745d99","releaseDate":"2016-02-01T23:55:56.544Z","__v":35,"createdAt":"2016-02-01T23:55:56.544Z"},"project":"56aff08c3a5b810d00745d99","__v":5,"parentDoc":null}

getWebsite In-Page Campaign API

The Website In-Page Campaign API returns resources for a specified user based on the configured Placement logic.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

site_id:
required
string
Unique identifier for your Boomtrain site.
identifier_type:
required
string
URL path parameter. Indicates the type of identifier used to identify the user. Currently-supported identifier types are `email`, `user_id`, and `bsin`. A user's `bsin` can be obtained through the route documented at [Get a Boomtrain Identifier for a Person](https://boomtrain.readme.io/docs/get-a-boomtrain-identifier)
identifier:
required
string
URL path parameter. Indicates the identifier for the user receiving recommendations.

Query Params

pname:
required
string
Identifies the Placement name. It can be picked as is from the Website In Page Campaign UI without the need of removing spaces
test:
booleanfalse
URL query parameter. If true then don't record recommendations. Accepts any of `t`, `true`, `y`, `yes`, or `1` as true, all other values are treated as false. Note that this value should NOT be set unless you are testing recommendations pre-deployment.

Documentation

## Request [block:code] { "codes": [ { "code": "curl 'https://onsiterecs.api.boomtrain.com/api/v1/osrs/your_site/email/[email protected]?pname=your_placement_name&test=true'", "language": "curl", "name": "Using Email Address" }, { "code": "curl 'https://onsiterecs.api.boomtrain.com/api/v1/osrs/your_site/bsin/Lhzn0ClM1A397PINUa%2BzVSoh%2BH06noQl%2F9wNxvKWLa8jEsNFj58yKhA6bOoeDNG2S6TYsmkkj6u7xDdcOcp1tA%3D%3D?pname=your_placement_name&test=true'", "language": "curl", "name": "Using BSIN" } ], "sidebar": true } [/block] [block:callout] { "type": "warning", "body": "When you're ready to deploy this endpoint, remove 'test=true' from the URL. Otherwise, user metrics will not be recorded.", "title": "Please note:" } [/block] ## Results [block:code] { "codes": [ { "name": 200, "code": "[\n {\n \"selector\": \"\",\n \"placement\": \"replace\",\n \"view-pixel-url\": \"https://redirect.api.boomtrain.com/vp/site/MPYIlJ5wVbiAk/WKDz+eTt7tPvJn8diIBkjyf0PO9vEUSI155pgjju+XgdHpH0S8sVcrTntNZ2A1954wgyZ80A==?c=None&b=None&p=True&rt=None&rid=None&r=None&rsid=ae3ace96-e701-11e5-9ddd-12d5480515d7\",\n \"recs\": {\n \"sections\": {\n \"recs\": {\n \"recs\": [\n {\n \"campaign_name\": \"Single Website Campaign\",\n \"click-url\": \"https://redirect.api.boomtrain.com/click/application/abc?r=article:1234&c=None&b=None&rd=http://example.com\",\n \"id\": \"39\",\n \"is_personalized\": false,\n \"props\": {\n \"campaign_name\": \"Managing Your Money & Lifestyle\",\n \"content\": \"carousel\",\n \"description\": \"Cut down on holiday costs this year with these 7 shopping secrets. You don't have to skimp on your best holiday gift ideas with these quick shopping tips.\",\n \"device\": \"Desktop, Mobile\",\n \"experience\": \"Default\",\n \"expiration_date\": \"2021-11-04T09:19:09.860000+00:00\",\n \"pubDate\": \"2021-11-04T09:19:09.860000+00:00\",\n \"resource-id\": \"39\",\n \"scenario_name\": [\n \"Unknown\"\n ],\n \"thumbnail\": \"http://images.boomtrain.com/nPxlsbnUidapRiOPVDYew7h3gk1qo7m95OPmYdPe67Y.png\",\n \"title\": \"7 Secrets to Shopping Smarter: Ways to Save Money on Holiday Gift Ideas\",\n \"url\": \"http://example.com\"\n },\n \"rec-id\": \"264f5c00-6eb5-4a35-9cdd-dd828d412c49:Single Website Campaign!recs!user_interest:0\",\n \"recset-id\": \"264f5c00-6eb5-4a35-9cdd-dd828d412c49\",\n \"resource-type\": \"article\",\n \"thumbnail\": \"http://images.boomtrain.com/nPxlsbnUidapRiOPVDYew7h3gk1qo7m95OPmYdPe67Y.png\"\n },\n {\n \"campaign_name\": \"Single Website Campaign\",\n \"click-url\": \"https://redirect.api.boomtrain.com/click/application/abc?r=article:0229&c=None&b=None&rd=http://example.com/2\",\n \"id\": \"86\",\n \"is_personalized\": false,\n \"props\": {\n \"campaign_name\": \"Market Outlook\",\n \"content\": \"carousel\",\n \"description\": \"The path to the U.S. presidency is a long and arduous one. With the U.S. election on November 3rd quickly approaching, uncertainty remains elevated.\",\n \"device\": \"Desktop, Mobile\",\n \"experience\": \"Default\",\n \"expiration_date\": \"2021-11-04T09:22:20.255000+00:00\",\n \"pubDate\": \"2021-11-04T09:22:20.255000+00:00\",\n \"resource-id\": \"86\",\n \"scenario_name\": [\n \"Unknown\"\n ],\n \"thumbnail\": \"http://images.boomtrain.com/EvA0Q1EjAgyK78AwUhzNqdq0WIt0oSXx6smKGv4hgc0.gif\",\n \"title\": \"Washington Watch: The Path to the Presidency\",\n \"url\": \"http://example.com/2\"\n },\n \"rec-id\": \"264f5c00-6eb5-4a35-9cdd-dd828d412c49:Single Website Campaign!recs!user_interest:1\",\n \"recset-id\": \"264f5c00-6eb5-4a35-9cdd-dd828d412c49\",\n \"resource-type\": \"article\",\n \"thumbnail\": \"http://images.boomtrain.com/EvA0Q1EjAgyK78AwUhzNqdq0WIt0oSXx6smKGv4hgc0.gif\"\n }, \n \"request_context\": \"user_interest\",\n \"type\": \"popular\"\n }\n },\n \"view-pixel\": \"https://redirect.api.boomtrain.com/vp/site/MPYIlJ5wVbiAk/WKDz+eTt7tPvJn8diIBkjyf0PO9vEUSI155pgjju+XgdHpH0S8sVcrTntNZ2A1954wgyZ80A==?c=None&b=None&p=True&rt=None&rid=None&r=None&rsid=ae3ace96-e701-11e5-9ddd-12d5480515d7\"\n }\n }\n]", "language": "json", "status": 200 } ], "sidebar": true } [/block] [block:html] { "html": "<div> \n<h4>View Pixel Tracking</h4>\nIn order to provide metrics and data to improve Boomtrain's recommendation systems, the `view-pixel` returned in the result of this call should be impressed whenever these results are viewed by a user. This can be done by adding an invisible image pixel into the HTML body where the request is being shown. For example, <span style='font-family:Consolas,Courier New,monospace'>&lt;img src=\"view-pixel returned by this route\" /&gt;</span>.\n</div>\n<style></style>" } [/block] [block:api-header] { "type": "basic", "title": "Results" } [/block] Note that the `view-pixel` should be rendered on each impression of a recommendation set in order to track views of recommendations. As well, the `click-url` should be triggered upon click of any recommendation in order to track clicks for the purpose of evaluating performance.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}