phplaravelvonage

How to create user and link to existing nexmo application?


Is posible to create user and link user to existsing application using vonage-php-sdk-core package? https://github.com/Vonage/vonage-php-sdk-core

i can make application and user with Vonage CLI, but i need to make it with PHP. is there a way?

nexmo app:create "My Sample App" --capabilities=voice,rtc --voice-answer-url=https://example.com/webhooks/answer --voice-event-url=https://example.com/webhooks/event --rtc-event-url=https://example.com/webhooks/rtc --keyfile=private.key

with vonage-php-sdk-core i can make application as well, but seems like i can't find method to create user.


Solution

  • The Conversation API (which encompasses Users, Members, and Conversations) isn't supported in the PHP SDK at the moment since the API is still in beta. Once that API goes fully live we will support it in SDKs other than the NodeJS SDK.

    There are some vestiges of the Conversation and User APIs in the SDK, but we've marked them as deprecated since it's an older version of the API.

    For the moment you should access the APIs using Guzzle or whatever HTTP client you are using (if you aren't specifying one, we should be pulling in Guzzle from Laravel).

    As for working directly with the API, https://developer.nexmo.com/conversation/overview is the entrypoint for the Conversations API. General API documentation is available at https://developer.nexmo.com/api/conversation, and demo code from cURL, which can be useful for seeing URL structures as well as payloads, is available at https://developer.nexmo.com/conversation/code-snippets/user/create-user/curl.

    Why don't we support this API?

    As a rule we don't add support in our stable SDKs for beta APIs, as that could lead to a lot of major releases with breaking changes, as the beta APIs only have a 6 month stability SLA and can change rapidly. We are looking at better ways to handle our beta APIs (the PHP SDK now supports a module system as of v2.2.0) so that devs can get access to these types of APIs quicker.