cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1004
Views
5
Helpful
3
Replies

Coding and API's question

Greetings all,

  I am going through the Coding and API's course: https://developer.cisco.com/startnow/#coding-apis-v0 and when I get to Section for What is REST? What is an API? and the section 4 which shows examples of Rest API

 

When I get to the Cisco Webex Teams API section and it tells me to go to https://developer.webex.com/docs/api/v1/people/get-my-own-details and I assume run the script to get it to send my authentication to the server:  

Run Rest.png

 

So right after I run this, from my Command Line I run this: 

C:\Users\wfsteadman>curl https://api.ciscospark.com/v1/messages -X POST -H "Authorization:Bearer YTQ3M2FkOTYtOWI0YS00MDg5LTk2YjQtNGJhN2M2NTlkYjNkNTg5ZjAyNjItZGE2_PF84_4a6cd7b4-8577-4edd-b5c1-d092ae05ece4" --data "toPersonEmail=wfsteadman@gmail.com" --data "text=Hi%20from%20DevNet"

 

And I get the following results:
{"message":"Failed to create room.","errors":[{"description":"Failed to create room."}],"trackingId":"ROUTER_5D02B18E-20EA-01BB-624C-49D9428E624C"}
C:\Users\wfsteadman>

 

So I am not sure if I am supposed to be doing something else to get the response the tutorial says I should get

 

Really interested in learning REST and API's but seems like I am stuck right at the starting gate and it says no experience necessary.  

THANKS IN ADVANCE

Wally

3 REPLIES 3
dporod
Beginner

Me too. Any luck?

AL6
Cisco Employee
Cisco Employee

If you're trying to send message to yourself, it will not work. Try and to set "toPersonEmail" to a different WebEx Teams contact.

alexstev
Cisco Employee

 

This is what works:

 

curl -H "Authorization: Bearer INSERT_ACCESS_CODE_HERE" 'https://api.ciscospark.com/v1/messages' --data 'toPersonEmail=INSERT_EMAIL_HERE' --data 'text=Testing 1,2,3. Just Joe Smith working on API. Please disregard'

 

And be sure to message someone with a Cisco email, other than yourself

Create
Recognize Your Peers
Content for Community-Ad