Jump to content

API Setup


digitauusa
 Share

Recommended Posts

Hello Guys,

New to this forum, was told by 2600hz.org that this would be a great place to start. We have completed the install of the open source platform, however, we do not see an option to add phone numbers in to the spare numbers form. Curios as to if anyone knows what I need to do to enable adding phone numbers in to the spare account of numbers? Also, how do we obtain credentials for api requests to start building the platform out?

https://docs.2600hz.com/supported/#introduction-to-crossbar-rest-apis

Link to comment
Share on other sites

Not sure what you mean by not being able to add numbers.  I just went to Number Manager > +Add and was able to add a number.

To read about the API you can use these docs
https://github.com/2600hz/kazoo/tree/master/applications/crossbar/doc

Maybe start here for credentials
https://docs.2600hz.com/sysadmin/doc/install/configure_kazoo/
https://github.com/2600hz/kazoo/blob/master/applications/crossbar/doc/basic_auth.md

You will probably want to look at using PostMan which can automate a lot of the things such as using credentials.
https://docs.2600hz.com/ui/docs/using-postman-as-a-crud/

Edited by amn (see edit history)
Link to comment
Share on other sites

# User/Pass credentials hash
echo -n "{USERNAME}:{PASSWORD}" | md5sum
{MD5_HASH}  -

# Copy the {MD5_HASH} and create an Auth Token
curl -v -X PUT -H "content-type:application/json" \
     -d '{"data":{"credentials":"{MD5_HASH}","account_name":"{ACCOUNT_NAME}"}}' \
     http://ip.add.re.ss:8000/v2/user_auth | python -mjson.tool

# Export the "auth_token" and "account_id" for easy use in later API requests
export AUTH_TOKEN="{AUTH_TOKEN}"
export ACCOUNT_ID="{ACCOUNT_ID}"

 

This where I tried to start with, however, it gives me this following issue:

 

 

Screen Shot 2018-06-03 at 1.46.38 PM.png

Link to comment
Share on other sites

Are you logged in as the top (superduper) user in master account?  You should see "+Add" option in Number Manager but I believe you only see that if you are superadmin or superduper.

If it says invalid credentials then there is (obviously) something wrong with your credentials.  Make sure you are generating a hash using the proper user/pass.

That screen shot is not telling me anything.  It looks like you are missing all the important bits at the beginning such as the generation of the user hash etc and then the actual curl command.

Link to comment
Share on other sites

On 6/3/2018 at 10:45 AM, digitauusa said:

When I go to the number management, It does not show the + Add, I have attached a screenshot of the screen.

In order to add spare numbers to an account, you need to buy them.

To do so, just click the `Buy` button corresponding to the account to which you want to add spare numbers to, and pick the number type and area code.

Once that's done, the numbers will be listed as spare numbers under the account you chose when buying them.

5b142934b15ed_ScreenShot2018-06-03at1_44_25PM.thumb.png.6a805e00fb1b286fe65dd070531b353e.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...