#!/bin/bash

tokens_file='/etc/direct-tokens/api_test_tokens'
client_login='lamodasem'
operator_login='at-direct-super'
oauth_token=$(grep $operator_login $tokens_file |awk '{print $2}' | head -n1)


SCRIPTPATH=`readlink -f $0`
SCRIPTDIR=`dirname $SCRIPTPATH`

source $SCRIPTDIR/beta_number

SERVICE_URL="$JSON_URL/adgroups"
echo $SERVICE_URL

curl \
     -k \
    -H "Authorization: Bearer $oauth_token" \
    -H 'Accept-Language: ru' \
    -H "Client-Login: $client_login" \
    -d '
  {
    "method":"get",
    "params": {
        "SelectionCriteria" : {
            "CampaignIdss" : [ 3346909, 3947153 ],
            "Ids" : [
                23884964,
                23884965,
                23884966,
                23884968,
                23884969,
                23884970,
                23884971,
                23884972,
                23884973,
                23884974,
                62913888,
                23884976,
                23884977,
                23884978,
                62913893,
                62913885
            ]
        },
        "FieldNames" : [
            "Id",
            "CampaignId",
            "NegativeKeywords"
        ]
    }
  }' \
    "$SERVICE_URL"

echo
