0% found this document useful (0 votes)
14 views

Curl Commands

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Curl Commands

Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

get token

_________________________
curl --location --request POST 'http://127.0.0.1:3080/login' --header 'Content-
Type: application/json' --data '{"username": "web_napi","password":"web12345"}'

curl --location --request POST 'http://127.0.0.1:3080/login' --header 'Content-


Type: application/json' --data '{"username": "vpnUser","password":"vpnUser"}'

company api

get company info


_______________________________
curl -X GET 'http://192.168.189.110:3080/api/vpn/companiesListExt?flt\
[companyId\]=44' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MjMxMzY1LCJleHAiOjE3MjQyMzQ5NjV9.urBYzBaL3X0XjXc27xjv
B-vmB6oh9RC7b7oiMLlv6Hw' -H 'content-type: application/json'

add

curl -X POST 'http://192.168.189.110:3080/api/vpn/companiesListExt/' -H


'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MTUyNzcwLCJleHAiOjE3MjQxNTYzNzB9.8HBZiDgBiz-
aZZZ4dpkJ_qxFr2t_ZXVU_npVdkziBLQ' -H 'content-type: application/json' --data
'{"companyId":"44","cmpName":"TestCamp44","cmpSk":"364","cmpPrefix":"888884","cmpSt
atus":"0"}'

delete
curl -X DELETE 'http://192.168.189.110:3080/api/vpn/companiesListExt/3000' -H
'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MjIzMjQzLCJleHAiOjE3MjQyMjY4NDN9.vHYeDLVK-
NWBnQAbLsufwtU36R6c0xzdR8l8Cns6EQ4' -H 'content-type: application/json'

UPDATE

curl -X PUT 'http://192.168.189.110:3080/api/vpn/companiesListExt/44' -H


'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MjI3NzIwLCJleHAiOjE3MjQyMzEzMjB9.jvXdyX6CqzaBk_jkDei9
0MUyOzo4cEmBfpRbjYi4LqU' -H 'content-type: application/json' --data
'{"cmpName":"Oredooo","cmpStatus":"5"}'
_______________________________________________

members api

get
_______________________________
curl -X GET 'http://192.168.189.110:3080/api/vpn/membersListExt?flt\
[companyId\]=4&fields\
[data\]=subscriberLongNumber,shortNumber,subscriberScreening&flt\
[subscriberNumberType\]=mobile' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzIzOTkwMjgxLCJleHAiOjE3MjM5OTM4ODF9.PeHMAOzaymxMB7_Ul1gl
USwyk5p36wtBgrmnYh5-BeQ' -H 'content-type: application/json'

add

curl -X POST 'http://192.168.189.110:3080/api/vpn/membersListExt/' -H


'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzIzOTkwMjgxLCJleHAiOjE3MjM5OTM4ODF9.PeHMAOzaymxMB7_Ul1gl
USwyk5p36wtBgrmnYh5-BeQ' -H 'content-type: application/json' --data
'{"subscriberNumberType":"mobile","subscriberLongNumber":"213898401815","shortNumbe
r":"12445","subscriberScreening":"1","companyId":"4"}'

delete
curl -X DELETE
'http://192.168.189.110:3080/api/vpn/membersListExt/{"companyId":"4","shortNumbers"
:\["11714","11722","11831"\]}' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzIzOTkwMjgxLCJleHAiOjE3MjM5OTM4ODF9.PeHMAOzaymxMB7_Ul1gl
USwyk5p36wtBgrmnYh5-BeQ' -H 'content-type: application/json'

UPDATE

curl -X PUT
'http://192.168.189.110:3080/api/vpn/membersListExt/{"companyId":"132","msisdn":"21
3898401803"}' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzIzOTkwMjgxLCJleHAiOjE3MjM5OTM4ODF9.PeHMAOzaymxMB7_Ul1gl
USwyk5p36wtBgrmnYh5-BeQ' -H 'content-type: application/json' --data
'{"shortNumber":"12449","subscriberScreening":"1"}'

---------------------------------------------------------------------------------

PBX
-----
store-pbx shortNumber

curl --location --globoff 'http://192.168.189.110:3080/api/vpn/membersListExt?


=null' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MjM2NDU0LCJleHAiOjE3MjQyNDAwNTR9.9f6Bd5sU49Pa6gEIkgYJ
Pj7Fzwnpzd0HEzL0jnJkKPg' -H 'content-type: application/json' --data
'{"subscriberNumberType": "pbx","shortNumber": "71711","companyId": "1"}'

store-pbx short number range with *

curl --location --globoff 'http://192.168.189.110:3080/api/vpn/membersListExt?


=null' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MjM2NDU0LCJleHAiOjE3MjQyNDAwNTR9.9f6Bd5sU49Pa6gEIkgYJ
Pj7Fzwnpzd0HEzL0jnJkKPg' -H 'content-type: application/json' --data
'{"subscriberNumberType": "pbx","shortNumber": "91711*","companyId": "132"}'

store-pbx shortNumber range

curl --location --globoff


'http://192.168.189.110:3080/api/{{domain}}/membersListExt?=null' -H
'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MjM2NDU0LCJleHAiOjE3MjQyNDAwNTR9.9f6Bd5sU49Pa6gEIkgYJ
Pj7Fzwnpzd0HEzL0jnJkKPg' -H 'content-type: application/json' --data
'{"subscriberNumberType": "pbx","shortNumberStart": "31722","shortNumberEnd":
"31725","companyId": "132"}'

-----------------------------------------------------------------------------------
-----
- 4.2.6 Delete number in PBX list API

destroy-pbx shortNumber list

curl --location --globoff --request DELETE


'http://192.168.189.110:3080/api/{{domain}}/membersListExt/{"companyId":"132","shor
tNumber":["12333","77780","77766"]}' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MjM2NDU0LCJleHAiOjE3MjQyNDAwNTR9.9f6Bd5sU49Pa6gEIkgYJ
Pj7Fzwnpzd0HEzL0jnJkKPg' -H 'content-type: application/json'

-----------------------------------------------------------------------------------
------

- 4.2.7 Get PBX list API

index-pbx list

curl --location --globoff


'http://192.168.189.110:3080/api/{{domain}}/membersListExt?
flt[companyId]=132&fields[data]=shortNumber
%2Ccompany&flt[subscriberNumberType]=pbx' -H 'Authorization: Bearer
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwidXNlcm5hbWUiOiJ3ZWJfbmFwaSIsInRva2
VuIjoiYWNjZXNzIiwiaWF0IjoxNzI0MjM2NDU0LCJleHAiOjE3MjQyNDAwNTR9.9f6Bd5sU49Pa6gEIkgYJ
Pj7Fzwnpzd0HEzL0jnJkKPg' -H 'content-type: application/json' --data ''

You might also like