api к порталу рабочее но странное. Спасибо уважаемому
Amir за титанический труд.
Периодически портал падает.
Тогда его тестим запросами вида :
Код:
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k https://agent.nexttvnet.ru/iptv-portal/backend/api/service -o services_0.txt
cat services_0.txt|jq -c '.data.service[]|[.serviceInfo.name,.id]'
printf '%b\n' "$(cat services_0.txt)"
a=xxx
b=yyyy
#
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k https://agent.nexttvnet.ru/iptv-portal/backend/api/abonentAccount/${a} -o contract_0_${a}.txt
printf '%b\n' "$(cat contract_0_${a}.txt)"
#
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k https://agent.nexttvnet.ru/iptv-portal/backend/api/abonentAccount/${b} -o contract_0_${b}.txt
printf '%b\n' "$(cat contract_0_${b}.txt)"
#
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k https://agent.nexttvnet.ru/iptv-portal/backend/api/tariff -o tarifs_0.txt
printf '%b\n' "$(cat tarifs_0.txt)"
cat tarifs_0.txt|jq -c '.data.tariff[]|.id,.name,(.serviceAttributes[]|[.type,.service_id,.price])'
#
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k https://agent.nexttvnet.ru/iptv-portal/backend/api/contractor/ -o abon_0.txt
cat abon_0.txt|jq '.'
cat abon_0.txt|jq '.data.contractor[2]'
printf '%b\n' "$(cat abon_0.txt)"
cat abon_0.txt |jq -c '.data.contractor[].contracts[].abonentAccount|.id,.blocked'
#
a=xx
b=yy
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k -X POST -d '{"id":"'"$a"'"}' https://agent.nexttvnet.ru/iptv-portal/backend/api/abonentAccount/block |jq '.success' > ${a}.txt
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k -X POST -d '{"id":"'"$b"'"}' https://agent.nexttvnet.ru/iptv-portal/backend/api/abonentAccount/block |jq '.success' > ${b}.txt
cat ${a}.txt
cat ${b}.txt
#
a=xx
b=yyy
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k -X POST -d '{"id":"'"$a"'"}' https://agent.nexttvnet.ru/iptv-portal/backend/api/abonentAccount/unblock |jq '.success' > ${a}.txt
curl -1 -u "login:passwd" -H "Content-Type: application/json" -H "Accept: application/json" -k -X POST -d '{"id":"'"$b"'"}' https://agent.nexttvnet.ru/iptv-portal/backend/api/abonentAccount/unblock |jq '.success' > ${b}.txt
cat ${a}.txt
cat ${b}.txt
Если в выхлопе появляются ошибки - стопудово остальное перестанет работать.
Ща пока тестируем, много непоняток , толи по причине api, толи по причине логики работы самого портала...