Get an exposure SQL model. Returns a single model by its ID for the organization, including its subject types and properties.
This endpoint requires the product_analytics_metrics_read permission.
OAuth apps require the product_analytics_metrics_read authorization scope to access this endpoint.
Arguments
Path Parameters
Name
Type
Description
exposure_sql_model_id [required]
string
The UUID of the exposure SQL model.
Query Strings
Name
Type
Description
include
array
Optional fields to include. Repeat this parameter to request several fields. counts adds
experiment_count.
{"data":{"attributes":{"created_at":"2024-01-01T12:00:00Z","experiment_column":"experiment_id","name":"Exposure events","properties":[{"column_name":"country","column_type":"STRING","id":"550e8400-e29b-41d4-a716-446655440031","name":"country","pipeline_column_suffix":"cty001"}],"sql":"SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures","subject_types":[{"column_name":"user_id","subject_type_id":"550e8400-e29b-41d4-a716-446655440010"}],"timestamp_column":"exposed_at","updated_at":"2024-01-01T12:00:00Z","variant_column":"variant"},"id":"550e8400-e29b-41d4-a716-446655440030","type":"exposure-sql-models"}}
Malformed exposure SQL model ID (not a valid UUID), or unknown include value.
# Path parameters exportexposure_sql_model_id="550e8400-e29b-41d4-a716-446655440000" # Use a Personal Access Token or Service Access Token exportDD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
"""
Get exposure SQL model returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.experiments_apiimportExperimentsApifromuuidimportUUIDconfiguration=Configuration()configuration.access_token=environ["DD_BEARER_TOKEN"]withApiClient(configuration)asapi_client:api_instance=ExperimentsApi(api_client)response=api_instance.get_exposure_sql_model(exposure_sql_model_id=UUID("550e8400-e29b-41d4-a716-446655440000"),)print(response)
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"python3"example.py"
# Get exposure SQL model returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.access_token=ENV["DD_BEARER_TOKEN"]endapi_instance=DatadogAPIClient::V2::ExperimentsAPI.newpapi_instance.get_exposure_sql_model("550e8400-e29b-41d4-a716-446655440000")
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"rb"example.rb"
// Get exposure SQL model returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2""github.com/google/uuid")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())ctx=context.WithValue(ctx,datadog.ContextAccessToken,os.Getenv("DD_BEARER_TOKEN"))configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewExperimentsApi(apiClient)resp,r,err:=api.GetExposureSQLModel(ctx,uuid.MustParse("550e8400-e29b-41d4-a716-446655440000"),*datadogV2.NewGetExposureSQLModelOptionalParameters())iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `ExperimentsApi.GetExposureSQLModel`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `ExperimentsApi.GetExposureSQLModel`:\n%s\n",responseContent)}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"go run"main.go"
// Get exposure SQL model returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.ExperimentsApi;importcom.datadog.api.client.v2.model.ExperimentsExposureSQLModelV2DTO;importjava.util.UUID;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));ExperimentsApiapiInstance=newExperimentsApi(defaultClient);try{ExperimentsExposureSQLModelV2DTOresult=apiInstance.getExposureSQLModel(UUID.fromString("550e8400-e29b-41d4-a716-446655440000"));System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling ExperimentsApi#getExposureSQLModel");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"java"Example.java"
// Get exposure SQL model returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_experiments::ExperimentsAPI;usedatadog_api_client::datadogV2::api_experiments::GetExposureSQLModelOptionalParams;useuuid::Uuid;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=ExperimentsAPI::with_config(configuration);letresp=api.get_exposure_sql_model(Uuid::parse_str("550e8400-e29b-41d4-a716-446655440000").expect("invalid UUID"),GetExposureSQLModelOptionalParams::default(),).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.