Closed wundo closed 9 years ago
did you print_r($response) to see what's happening?
Yes I did, $response->getData()['opportunities'] is empty
Okay I'm not familiar with the details of how this library works, but the Close.io REST API doesn't support creating Opportunities by posting them inside of a Lead. To create an Opportunity via the API you have to send a POST to the Opportunity endpoint on its own, after the lead is created. @mickadoo will have to let you know how to do that in this library, if it's supported.
(Alternatively you could use a lightweight requests wrapper to do it)
requests wrappers seems too much like a "quick hack" for me, no offense intended.
No offense intended - though it's not a hack, it's just simply using a REST API without a PHP code having to be written to wrap each API endpoint & method. I'm glad this library exists and I hope @mickadoo can help you :)
@wundo - we just started out with implementing the lead api wanting to implement the others whenever needed. We will remove the opportunity from the lead api to clean things up and implement the opportunity api. Should be ready somewhat today.
Also it would be nice if could ask you to test the feature branch with the opportunity api once we are ready before we actually going to merge it back to the master and tag it.
Best Marco
@wundo I've added the OpportunityApi in the branch feature/9_add-opportunity-api
You can see how to use it in the updated README.md in that branch. Would you be able to test it to see if it satisfies your requirements?
Michael
@wundo New release (v0.1.0) should address your problem. If you have any issues just let me know.
Michael
Awesome! thanks :)
Try:
Nothing happens :(