How to integrate infusionsoft-php-sdk in cakephp3 - cakephp-3.0

I want to create a contact in infusionsoft from cakephp code, I have put infusionsoft sdk inside vender folder and call include file in my controller but it giving error when creating object of infusionsoft.

I have resolved error myself by simply write use classname;
Classname is which object we want to create in controller.

Related

Send File to FrontEnd in feathers JS

I need to send an image to front end (avatar user) in the services 'users'. The file is stored in ./uploads/avatar. My question is do I have to do an after HOOK or custom service when I use GET on service 'users'? Where do I need to write my res.status(200).sendFile(filepath)?

MEAN.js $http.get() return index html content instead of json file

I'm doing a web app based on original MEAN.js framework. When I want to request local json test file using $http.get() method in my AngularJS file, it returned my index html content.Is it a routing problem? I didnot change the original mean.js routing code(https://github.com/meanjs/mean), just added a $http.get() method in home.client.controller.js file. Can anyone help me with this? Thanks!
That is most likely happening, because you didn't define an endpoint for that particular GET request in your app.
Everytime you make a request to your server (for example a GET request to /my-request) nodejs/express are configured in MEAN.js so that your server will try to find the endpoint for that request, if it does not find any, that request will be handled by this particular code block (specified in /modules/core/server/routes/core.server.routes.js):
// Define application route
app.route('/*').get(core.renderIndex);
Which will basically render the index view.
I'm not sure if you're using a custom module or not, eitherway, if you want that request to be handled in a different way in MEAN.js, you can specify your endpoint in your custom module routes file (or in core.server.controller.js) like so:
// Define application route
app.route('/my-request').get(core.sendMyJSON);
Be careful, because this route must be placed before the one I mentioned earlier, otherwise your request will still be handled the same way and the index view will be rendered and served again.
Then you will have to create the controller that should be called to handle that request:
exports.sendMyJSON = function (req, res) {
// logic to serve the JSON file
};
This way you should be able to get it done with a few adjustments.
Side note:
I'm not entirely sure but I think if you place your JSON file in the public directory of your app you should be able to directly access it without the need for the extra logic.

ASP.NET WEB API PUT method Nullreference Exception

I'm trying to pass an object named "User" with user data in HTTP PUT method. I've created a custom controller method, gave it a [HttpPut]. In my application i'm calling a proper route with PUT header, but when i'm trying to pass an User object in JSON format my WEB API is throwing nullreference exception, which indicates that user object isn't passed. MY other custom POST methods are working fine, I'm having problem only with PUT method. My object in JSON format has proper formatting, I double-checked. What may be causing the problem?
I managed to fix the problem. In my User model constructor i deleted initialization of lists of other objects and it worked.

call json web api nopcommerce

Hi I am new for nopcommerce 3.5. I need to write a restful web service api to third party(for eg mobile) access the service. I know that we can access through Nop.Plugin.Misc.WebServices . I had enable the service from administrator site.
But now is my question. How can i call the web service for eg GetPaymentMethod , product list and etc
And if I want to write my custom web service by using web api. what is step to create? I cant find any documentation about the web service. Please guide me some example
Thanks
If you want a really quick start in writing a web service in NopCommerce, you can follow the MVC architecture and:
Create an Action method inside a Controller that you find appropriate for your purpose. For example, if you want access to a product list, you might create an Action inside CatalogController that follows the logic of the existing ProductList action.
Set up a Route in RouteProvider.cs to point to the Action you created. Based on this route you can deduce the URL of your service.
Do the processing that you need inside the Action. If this Action/service is to be called with parameters (in query string format: param=value&param2=value2), you can just put these parameters in the Action's header:
public ActionResult QuickService(int param, string param2) { ... and .NET will take care of having them initialized.
Store results in an object (can also be an anonymous object) and at the end of your action, return it as Json: return Json(resultsObject); Again, ASP.NET takes care of the JSON serialization and automatically sets the Content-Type HTTP response header to "application/json".
You can consume the service calling the URL that corresponds to the route of your Action.
If you want users to be able to log in, by using the above method, it gets a little bit trickier. You need the webservice client to be able to accept and send cookies, as well as make appropriate services for Login, Logout, Register,...
However, in this case, you might be better off with a mobile version of the site.
Final note: If you don't want to alter base NopCommerce code, you can apply the steps above to a plugin. The majority of NopCommerce plugins follow the MVC architecture, so you can apply the steps above.

How to handle object ID's in ember.js?

I was just experimenting building a tiny app with Emberjs as my frontend framework.
All the app is, is a list which I can add names to with a textbox and button, then remove names from the list by clicking the delete button after each name.
I'm using a very simple Symfony2 application as my data store via a REST API and can currently add names to the list no problem. What I don't understand is how to go about deleting them.
If I add a new name to the list, it won't have the unique ID (my objects have an id and a name) that would be assigned by the DB engine, so when I come to delete it, I can't pass an ID to the DELETE API call.
How do I fix this? Do I need to somehow return the complete object (with ID) when calling the create API call and update the object (how would I do that with Ember?) or is there some other way of doing it?
Edit: Added an image better illustrating my question:
As already mentioned in the comments, when you create a new record the Store set's an internal id for the record, then when you commit to your backend your API should conveniently return the entire object back (with it's new id) ember will then take care to set the new server-side generated id back to your internally newly created record in the Store.
Your server should be serializing the id back to your ember app. If you're using Ember Data and your models are extensions of DS.Model, you don't have to define the id property on the model, but you can still use it.