# GraphQL: how to list SIP secrets

**URL:** <https://community.freepbx.org/t/graphql-how-to-list-sip-secrets/63529>\
**Category:** Development\
**Created:** [December 30, 2019, 4:07pm UTC](https://community.freepbx.org/t/graphql-how-to-list-sip-secrets/63529 "2019-12-30T16:07:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliv2831](https://community.freepbx.org/letter_avatar_proxy/v4/letter/o/3da27b/32.png) [@oliv2831](https://community.freepbx.org/u/oliv2831)\
**Post date:** [December 30, 2019, 4:07pm UTC](https://community.freepbx.org/t/graphql-how-to-list-sip-secrets/63529/1 "2019-12-30T16:07:16Z")

</div>

Hi,  
I’m discovering FreePBX 15’s GraphQL feature.  
{  
allExtensions {  
extension {  
extension  
id  
user {  
name  
password  
sipname  
extension  
}  
}  
}  
}

With the above request, I’ve got the bellow answer.  
{  
“data”: {  
“allExtensions”: {  
“extension”: [  
{  
“extension”: “4444”,  
“id”: “ZXh0ZW5zaW9uOjQ0NDQ=”,  
“user”: {  
“name”: “John Doe”,  
“password”: “”,  
“sipname”: “”,  
“extension”: “4444”  
}  
}  
]  
}  
}  
}

How can I get all extensions with their SIP password ?  
Best regards

---

<div class="post-metadata">

**Author:** ![oliv2831](https://community.freepbx.org/letter_avatar_proxy/v4/letter/o/3da27b/32.png) [@oliv2831](https://community.freepbx.org/u/oliv2831)\
**Post date:** [December 30, 2019, 4:16pm UTC](https://community.freepbx.org/t/graphql-how-to-list-sip-secrets/63529/2 "2019-12-30T16:16:46Z")

</div>

1. Sorry for my above message identation (I forgot to use appropriate edition options). I’m reallu sorry for that.

2. Having an equivalent request that would REST instead of GraphQL is an acceptable work around for me.  
All I currently need is way to list all SIP accounts with secret and display names.

---

<div class="post-metadata">

**Author:** ![oliv2831](https://community.freepbx.org/letter_avatar_proxy/v4/letter/o/3da27b/32.png) [@oliv2831](https://community.freepbx.org/u/oliv2831)\
**Post date:** [December 30, 2019, 5:48pm UTC](https://community.freepbx.org/t/graphql-how-to-list-sip-secrets/63529/3 "2019-12-30T17:48:55Z")

</div>

Working on the same platform (FreePBX 15, Asterisk 16.4.1) , I added a chansip extension.  
Looking at SIP traffic, I observed Asterisk required PJSIP or chansip extension to use configured SIP secret.

I exported extension data with Bulk Handler tools.  
For both, a “secret” field was and “password” wset !

It seem

---

<div class="post-metadata">

**Author:** ![oliv2831](https://community.freepbx.org/letter_avatar_proxy/v4/letter/o/3da27b/32.png) [@oliv2831](https://community.freepbx.org/u/oliv2831)\
**Post date:** [December 30, 2019, 5:52pm UTC](https://community.freepbx.org/t/graphql-how-to-list-sip-secrets/63529/4 "2019-12-30T17:52:03Z")

</div>

For both, a “secret” field was and “password” was unset !  
I confused both in my previous query but my first question remains:

how can I get this secret field withe either REST or GraphQL API ?

---

<div class="post-metadata">

**Author:** ![oliv2831](https://community.freepbx.org/letter_avatar_proxy/v4/letter/o/3da27b/32.png) [@oliv2831](https://community.freepbx.org/u/oliv2831)\
**Post date:** [December 31, 2019, 5:55pm UTC](https://community.freepbx.org/t/graphql-how-to-list-sip-secrets/63529/5 "2019-12-31T17:55:59Z")

</div>

The elements bellow worked (after 40 or more different attempts) ! I hope this will help others (and save them 39 attempts) !

{  
allExtensions {  
extension {  
device {  
tech {  
\_\_typename  
… on pjsip {  
secret  
}  
}  
}  
extension  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://community.freepbx.org/uploads/default/original/3X/f/7/f7056d57e04fdbf71c6ad967e1ced351317f5c3f.png) [@system](https://community.freepbx.org/u/system)\
**Post date:** [January 7, 2020, 5:56pm UTC](https://community.freepbx.org/t/graphql-how-to-list-sip-secrets/63529/6 "2020-01-07T17:56:01Z")

</div>

Closed on January 7, 2020, 5:56pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
