Rich-text Reply

Bucketed Variation via REST API

anbarasiu 07-01-16

Bucketed Variation via REST API

We’re working on a React application that is rendered on the server-side and I’m experimenting with integrating the Optimizely experiments on the application via code.

 

I’m able to access the configured experiments and variations via the REST API, but would like to know if there’s any way to get the details of the variation the user will be bucketed into, via the REST API, instead of the JavaScript API?

 

Thanks,

Anbarasi U

Re: Bucketed Variation via REST API

Hi anbarasiu,

 

Thanks for posting your question here!

 

The REST API cannot be used to get information on a visitor's state, so you won't be able to get the details of the variation the user will be bucketed into via the REST API. There also isn't any way to know beforehand which variation a user will be bucketed into, since the bucketing is done at runtime, client-side.

 

You can execute JS API in the variation code/experiment code if you want to get and use this information after a visitor is bucketed. What are you looking to use the details of the variation of the user for?

 

Best,

Nils

szimek 03-07-17
 

Re: Bucketed Variation via REST API

[ Edited ]

Hi Nils_van_Kleef,

 

we got a similar issue - we plan to render a React app on the server side and thought about using Optimizely as a feature flag system. Has anything changed since you replied to this question last year? Is it already possible to get variations for given user?

Level 2

Re: Bucketed Variation via REST API

Hi Szimek,

 

Thanks for your question - something has indeed changed since last year! We've launched our Full Stack product late 2016. One of its use cases is for expert web-implementations such as yours with React, and another is to use it for feature flags. 

 

Please have a look at these different resources we have for our Full Stack product:

Does this sound like what you're looking for?

 

Best,

Nils

 

szimek 03-13-17
 

Re: Bucketed Variation via REST API

Thanks!

Level 2