trendmanagement / tmqrexo_alexveden

1 stars 1 forks source link

Campaign info api #171

Closed spickering-git closed 7 years ago

spickering-git commented 7 years ago

@alexveden Can you please add this functionality to the api when asking for the list of campaigns

http://66.70.157.69:28864/api/campaigns/list/ default will have no parameters and that will return everything, the same way it works now.

if input "white_label=" example http://66.70.157.69:28864/api/campaigns/list/?white_label=DHP

now the campaigns collection in mongo has a new field called 'white_label'

{
"_id" : ObjectId("584f50e24251c3a2bb7f93f0"),
"name" : "CL_Bidirectional V3",
"white_label" : {
        "DHP" : {
            "name" : "McKeany-Flavell Fuel DHP"
        },
        "ADM" : {
            "name" : "ADM Fuel DHP"
        }
    }
}

if the 'white_label' field contains a parameter "DHP" you return that campaign. Also can you change name of the campaign to the 'name' field in the white_label.

GET /api/campaigns/list/?white_label=DHP

would return

HTTP 200 OK
Allow: GET, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "campaigns": [
        {
            "description": "Bidirectional Premium Collection of Crude Oil Feb 15 2017",
            "name": "McKeany-Flavell Fuel DHP",
            "instrument": "CL"
        }
}
alexveden commented 7 years ago

Fixed

spickering-git commented 7 years ago

@alexveden I didn't clarify if input "white_label=" example http://66.70.157.69:28864/api/campaigns/list/?white_label=DHP

only return campaigns with a 'white_label' field containing 'DHP' in this case

alexveden commented 7 years ago

Fixed