athuldilip | 2018-04-26 12:42:50 UTC | #1
I want to create an ivr flow and configuration completely from api ( not from the architect ). I checked the API's in Architect API Resources and there is an api for creating a flow to which flow configuration uri has to be passed but the problem is I can't find any api to add a flow configuration
anon28066628 | 2018-04-26 14:18:38 UTC | #2
There isn't a public REST api for creating flow configurations, however this Node scripting library will generate a flow configuration and publish the flow.
athuldilip | 2018-04-27 13:44:46 UTC | #3
Thanks. I tried it out and It did not work when tried to authenticate with a client credentials token but worked perfectly with a user token. In my case I want to use client credentials token because I will be refreshing the token from a cron job instead of forcing the user to login when token expires.
So Is there any way to access the scripting library using a client credentials token?
anon28066628 | 2018-04-27 14:32:47 UTC | #4
The client/secret startup method is for 'code authorization' Oauth, which is user interactive (a web browser is opened). There isn't built-in support for client credentials, but you can implement that separately in a small method (it's fairly simple) and pass the token into the StartWithAuthToken method. A client credentials token will work with this library*, there just isn't support for starting up with the client credentials client and secret yet.
* assuming the oauth client has role with proper permissions assigned.
athuldilip | 2018-04-28 14:42:04 UTC | #5
When I tried calling StartWithAuthToken with the client credentials token the error that I'm getting is ERROR! error getting user:. Is it because my oauth client doesn't have proper permission? Oauth client right now has the admin role. PS : Apart from the documentation are there any examples or sample codes for the flow scripting sdk. That would really help me out!
anon28066628 | 2018-04-30 13:49:56 UTC | #6
Hello, the Node package should come with some example scripts - I uploaded them here.
With Client Credentials there are endpoints that will not work, such as /users/me. Such endpoints require user context, and with client credentials there is no logged in user. Endpoints for analytics, managing flows, and other org-level configurations will work if the proper permissions are in a Role assigned to the OAuth client.
athuldilip | 2018-04-30 15:37:28 UTC | #7
Thank you so much for the examples. That's exactly what I was looking for
system | 2018-05-31 15:37:35 UTC | #8
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 2790