Skip to content

Latest commit

 

History

History
109 lines (69 loc) · 2.61 KB

DistributionApi.md

File metadata and controls

109 lines (69 loc) · 2.61 KB

Jsflagr.DistributionApi

All URIs are relative to http://localhost/api/v1

Method HTTP request Description
findDistributions GET /flags/{flagID}/segments/{segmentID}/distributions
putDistributions PUT /flags/{flagID}/segments/{segmentID}/distributions

findDistributions

[Distribution] findDistributions(flagID, segmentID)

Example

var Jsflagr = require('jsflagr');

var apiInstance = new Jsflagr.DistributionApi();

var flagID = 789; // Number | numeric ID of the flag

var segmentID = 789; // Number | numeric ID of the segment


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.findDistributions(flagID, segmentID, callback);

Parameters

Name Type Description Notes
flagID Number numeric ID of the flag
segmentID Number numeric ID of the segment

Return type

[Distribution]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

putDistributions

[Distribution] putDistributions(flagID, segmentID, body)

replace the distribution with the new setting

Example

var Jsflagr = require('jsflagr');

var apiInstance = new Jsflagr.DistributionApi();

var flagID = 789; // Number | numeric ID of the flag

var segmentID = 789; // Number | numeric ID of the segment

var body = new Jsflagr.PutDistributionsRequest(); // PutDistributionsRequest | array of distributions


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.putDistributions(flagID, segmentID, body, callback);

Parameters

Name Type Description Notes
flagID Number numeric ID of the flag
segmentID Number numeric ID of the segment
body PutDistributionsRequest array of distributions

Return type

[Distribution]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json