How to do REST API Call from a Salesforce Commerce Cloud Store Front Page? - salesforce-commerce-cloud

I am new to Salesforce Commerce Cloud(SFCC). I would like to do REST API call to an external system when a storefront page's button is being clicked. What are the available ways to achieve this?

There are no extra requirements for it. You can consume a REST API via javascript. Or you can use the Service framework on the backend side.

Related

How to implement Amazon MWS api in MVC Web API?

I am new to Amazon marketplace web service (MWS). I have read documentation of web service but I am unable to understand which api suit for update quantity and price of single or multiple product at one time.
Here is link that I am reading so far and don't know where to start.(http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html)
Can you guys suggest me where to start?
Check out the feed types. You're going to want to submit a pricing or inventory feed to update your inventory. Once you have a feed created, you submit that using the SubmitFeed operation.
For an overview on how feeds works, check out this What you should know about the Amazon MWS Feeds API section.
Specifically for ASP.NET, there is an SDK built that will help you greatly. If you want to know how to implement that as a web api, that's another topic, but you can wrap code from the SDK inside a web api endpoint. But start with understanding MWS.

Mongolab API with ajax

I'm trying to build an app with comment system and wanna know if
is there any safe way to use the mongolab api without share my key with everyone?
if not what you guys recommend to use instead of mongolab api key with ajax.
Thanks.
Unfortunately there is no way to use the mLab Data API with Ajax and keep the API Key safe. We recommend implementing your own RESTful API server on top of your mLab database that can act as a gatekeeper to the database. Your client application would then make Ajax requests to the API server.
Although this tutorial uses Angular instead of Ajax, here is a good example of the architecture I've described: https://devcenter.heroku.com/articles/mean-apps-restful-api.

Has anyone developed Mobile apps against Magento's backend using Magento's SOAP APIs?

We are trying to make the decision if it is worth proceeding to use the Magento's SOAP APIs for our mobile App or if we should rewrite them as custom REST APIs.
We are using Magento 1.9.2.1 where the support REST APIs is limited, unlike SOAP APIs. To save us time, we would rather use the SOAP APIs but not sure if SOAP is a good for a mobile app in terms of latency compared to REST.
You should create custom module and create your own Rest API there. because none of the Magento's soap and rest API are complete .
how to create phonegap app using magento soap or rest api
Magento APIs are very slow and not supports all activities hence not recommended.
Create your own custom APIs.
Or use some free or commercial Magento Admin solutions and build over them.

Api and consumer flow

I am developing an API for a social network website. This API will basically get all the requests from the users (get friend list, post a status update etc) and reply back if necessary.
We will implement OAuth 2.0 protocol for authentication. Consumer (our php project) has API id and secret.
Basic scenario:
Client wants to log in
API Consumer (php web project) takes this request, directs user to API
User send his/her user credentials to the api, gets the token.
User comes back to our website, pass token to the consumer.
Consumer goes to the api server, gets the access token.
Now consumer (php project) has access to user's private information.
Since this is a social network website, we want app developers to be able to use our API in the future.
I am not experienced in API-design. Does that flow make sense? I guess the simplest authentication would be accessing user information through php project. But we don't want to access database in php code. We will use ajax in client side and send a request to the API. And I believe there should be a better solution, what would you suggest?
Sure, API design is basically point where you need to choose technology.
Either it can be PHP or .net or Java.
I would prefer either PHP or .Net as we get lot of flexibility in it.
API will return XML or Json depending upon the request.
There are lot of CMS in php which can be helped.
.net we have Service Stack to help you.
API's had to be fully independent from other world as well as within API method as well.
If you are able to achieve this, then you will surely create a good architecture.

is it possible to use twitter Bootstrap->front-end + Spring-Hibernate->Backend in a web app that requires storage of session data

I want to create a web app that uses Twitter Bootstrap for the front end, and the backend uses Spring+Hibernate.
Now, some data has to be stored in each user's session-- how do I store/manage such data?
Do I have to use a 3rd party JS framework like Angular (by Google) or some other framework for this purpose?
Also, in such a hybrid app, should I use the JS framework (like Jquery or Angular JS) for storing the data and then send it to the Spring + Hibernate API? What I mean is, I can as well store the object-> relational DB mapping in the js framework, and use Spring only for basic database inserts/updates/selects?
Twitter bootstrap is a CSS framework with some javascript plugins, and is not a language in itself. Using it or not using it will have no impact on what you can/can't use on your backend.
As for sessions; sessions should always be stored server-side... therefore using Bootstrap will have no affect on your implementation of sessions.
Finally, in regards to keeping any of your database logic client side in javascript, NEVER do this. Javascript code can extremely easily be modified by the user, so anything client side should be considered unsecure. Do not ever put anything unsecure in your database.
We can use Twitter Bootstrap for the front end, and Spring MVC -> REST API for the back end...
For simple apps, ex search-only apps we can straightaway create an API and use JQuery to connect to the API and fetch data.
For more complex apps, the problem is that REST APIs dont store session data... For this, however we can use Spring MVC-> REST API as that has support specifically to handle sessions.
Refer http://tedyoung.me/2011/10/19/practical-spring-mvc-part-5-sessions/ that explains how to store session data using Spring MVC- and the front end is a simple HTML/CSS web page.

Resources