How Telecom Enterprises can leverage APIs to create new revenue streams

Posted by Sanjay Rohila on Dec 28, 2018 12:39:00 PM

The telecom industry is said to be approaching a tipping point. While revenues might not exactly be falling, there is a definite slow down in growth. With little focus on introduction of new services, most communication service providers (CSPs) are competing over the same existing market, and experiencing high customer churn rates.

Current Challenges in Telecom

At the heart of this crawling growth are a few key challenges that telecom enterprises have to address:

Staying Relevant to the Customer

Everything that one could do over the phone can be done over the Internet today. Messaging, voice, and video calls are all being offered by a host of applications. OTT services have become the primary point of connection for consumers when it comes to communication; be it messaging, video calling, and increasingly voice calling as well. And they appropriate a large share of the revenues generated as well.

OTT revenue cannibalization - Telecom API blog

Source: www.mckinsey.com quoting Ovum; McKinsey analysis

In the absence of any new value-added services, telecom operators have become mere connectivity providers. And even if they focus on improving connectivity, say with the introduction of 5G, customers are likely to take it for granted.

The bottom line is customers hardly recognize the relevance of the telecom provider in their communications. One telecom provider is as good as the next one, because everything they care about is actually delivered by OTT services.

Lack of New Business Models

In order to be noticed by the customers, telecom operators have to develop and deliver new services. And that is proving to be an uphill battle because they are hardwired to build networks.

Within the existing structure and leadership, the dominant response is to drive down cost on network operation to remain profitable. And while that is a way to go, it’s not enough. Telecoms have access to a lot of network assets and data that could potentially give rise to new services. But change is always resisted, and hence CSPs have not been able to develop new business models for revenue.

Slow Technology Adoption

Along with a change in the business strategy, telecom enterprises will have to optimize operations to even begin to deliver new services. They will also need new technology expertise to create and deliver value-added services. But once again, this is an aspect that CSPs have been slow to adopt.

How Can APIs help Telecom Operators

Telecom APIs can be a key piece for telecom operators to transform their value propositions.

Developing New Services

API gateways are the most efficient way to access and use information assets stored across legacy systems. Telecom operators already have huge amounts of user data, and APIs are the most secure way to expose this data for developing new services at scale. This would be true for both B2C and B2B services.

Hybrid B2C Services: APIs give telecom operators the opportunity to share information assets with other third-party service providers. This could lead to the development of hybrid services that can compete with existing OTT services.

A key example of this would be customer authentication services. Since telecom operators offer connectivity to all manner of services, that can be the unified access to all of these services. A one-step login to all applications would be a major convenience for consumers, and also bolster data security. And this would strengthen telecom’s collaboration with other service providers.

Value-added B2B Services: B2B enterprises present a highly profitable market for CSPs because:

  • Enterprise are willing to pay more for value-added services
  • Lower chances of being usurped by OTT service providers, at least in the near future

 

Exposing APIs is one of the most convenient ways to productize existing telecom assets, and create custom solutions for B2B enterprises. The opportunities here could be in the form of:

New Solution Bundles: Given that CSPs already own and operate widespread networks, they can offer new solution offerings that provide the usual gateways for voice and video calls, messaging, bundled with payment gateways and location services enabled by APIs.

Data as a Service: A host of enterprise applications rely on communication databases to deliver services. CSPs have access to vast amounts of user data, which can be made available to enterprises via APIs, as they build new customer solutions. Telecom APIs can monetize this data sharing to add new revenue streams. They can also create APIs that allow the CSP’s billing systems to be used by enterprises, charging a transaction fee for the convenience.

Monetizing Network Assets

Telecom operators have a set of core assets that are being utilized by OTT services. APIs offer a way to commoditize these network assets and create new revenue models:

Flexible Charging Models for Network Usage by OTTs

The network established by CSPs is their biggest asset, and the key to OTT services being able to deliver value to customers. APIs can help efficiently monetize this asset and create variable charging models for different types of OTT services. They can be charged on the basis of volume of usage, number of transactions, or other custom models as applicable; and this is managed by telecom APIs.

IoT Ecosystems and Edge Augmentation

With the rise in interconnected device ecosystems, telecom operators have a huge market just waiting to be leveraged. There’s B2C categories like GPS and other telematics devices, and also B2B use-cases where machine-to-machine communications, both wired and wireless, are witnessing large-scale adoption. Since all data is being transmitted over carrier networks, CSPs can create new pricing models for network usage.

Telecom operators can offer computing capabilities closer to the source of data generation, at the edge of the networks. Telecom APIs can be the key to transferring IoT data to computing applications and to the end user.

Srijan is working with leading telecom enterprises across US, Europe and APAC region to drive their digital transformation via successful API management, monetization, and governance. Let's get the conversation started on how Srijan teams can help leverage APIs for your enterprise.

Topics: Telecom, API Management

API Developer Portal: The key API onboarding platform

Posted by Gaurav Mishra on Dec 1, 2017 2:17:00 PM

Once an enterprise builds out its API strategy, gets the APIs in place, the success is contingent on how well the APIs are used by the target consumers, the developers. How easily can the developers find and consume your APIs - that becomes a critical element for the success of your API business. 

Beyond that, how engaged a community can you build around your APIs, so you have a committed, thriving ecosystem that gives wings to your API business. That is why an API portal is a key peg in your API lifecycle management plan. 

Out-of-the-box developer portals come as part of API Management platforms. For example, Apigee’s platform comes with the classic option of Drupal-based CMS portal, or a simpler one that uses Markdown. You can customize API portals to suit your business, so you can go live faster. Let’s look at what your API developer portal should have.

What do developers need?

It is the developers who will create applications that will make use of your APIs, thereby creating value for the end customers. They need the following features:

  • A search function to quickly find APIs of their interest

  • Ability to manage their credentials

  • Try out an API, without having to write code for it through an API Console

  • Understand API usage limits for the plan they sign up for: quota, throttling limits, etc

  • Easy access to terms of use of the APIs

  • Manage the various stages of their app: create marketing content, be able to connect with the developer community so that they can seek feedback, ask for help or give suggestions

  • Be able to manage the API lifecycle, from the sandbox to the production environments 

  • Get access to the pricing plans, usage, reports, billing details, etc.

 

A developer who is interested in your APIs but doesn’t have a good enough user experience with any of the above parameters, might not get on-boarded at all. This is the point where enterprises lose most developers. If you can hold on to them here and make it really easy for them to sign up, test out things, find the info they need, then you’d have increased the chances of onboarding them. 

Some of the things you must ensure are:

  • Is the messaging about the API, who is it for, its benefits, etc, available up front? And is it easy to understand?
  • Is it easy to access the APIs? 
  • Do you have example code they can easily view? Is there a demo?
  • Do you have an API console that lets them try out how the API works?
  • Are the relevant SDKs and libraries easily available? In the languages and platforms they prefer to work in?
  • How good is your documentation? And is it in formats they can search and easily refer to?

 

You can get out-of-the-box portals from various API management platforms such as Apigee or WSO2. You can then customize them to have your company branding, as well as have the kind of features and workflows you will need for your API business. APIGEE’s Drupal-based developer portal, built on the tenets of Content, Community and Commerce, allows itself for customization that your API business needs. Srijan has expertise in having customized such portals for various enterprise customers.

Srijan has also built a Drupal developer portal distribution to augment WSO2 Carbon. This is expected to be open sourced in a few week’s time.

Srijan's API Management teams are equipped to create and customize developer portals for your enterprise APIs. Drop us a mail and we can get the conversation started.

Topics: API Management

What do you need for a successful API business?

Posted by Gaurav Mishra on Nov 8, 2017 4:46:00 PM

Your organization has embarked on an API strategy perhaps, but is still pre-revenue with it. In fact, it doesn’t even look as if it will generate any significant revenue anytime soon. So while the intent to have an API business strategy was great, the implementation just hasn’t matched up. 

That’s not us saying it like it is. It’s The State of APIs: 2017 Report: How APIs Power Digital Ecosystems, a report by Apigee based on “the hundreds of billions of API calls in the Apigee Cloud from hundreds of customers (in 2014-2016), as well as surveys conducted with customers across a variety of verticals.” That’s data we can get behind.

And what the data says is this: there is a clear and vast difference between the best performers (who have apps as well as API traffic) and the others. For example, the top quartile companies account for over 90% of the API traffic on Apigee Cloud. There’s something that the top quartile companies are doing, that other enterprises trying to execute their API strategy need to study. This report is about that. Here’s what they are doing right.

They look at two things: the business case; and the developers and partners. They obsess about the developers, and they focus on the business aspect as well.

Are APIs strategic to your business?

Yes, of course. Over 85% of the top quartile companies say Yes. But the others are not very far behind - close to 75% of the second quartile companies say Yes as well. And the third quartile are not lagging too much. So there’s a clear understanding among Apigee’s customer base largely, that “enterprises use APIs and API platforms to quickly deliver new apps while leveraging existing legacy services.”
                    

Are you addressing the right business use cases?

If APIs are strategic to the business, it follows then that the stakeholders must be defining APIs to ensure the right business use cases. Right? Take a look.

Insights for a Successful API strategy

Source: The State of APIs: 2017 Report: How APIs Power Digital Ecosystems
Well over 60% of the top quartile companies think they are defining APIs by business use cases. While the bottom quartile largely focuses on technical integration with APIs. 

So enterprises need to explore how they will identify the business use cases to define APIs, what is priority and what can be part of the backlog. Here are some questions to ponder about:

  • How many takers are there for the API? 

  • What volume of calls can be expected? 

  • How many similar APIs exist?

  • What are our differentiators? 

  • How easy is to communicate our value proposition?

 

Depending on what aspects are important to your business, more questions can emerge that will help you define the APIs. However, this means that there has to be serious intent from the strategic API team to get this ball rolling, and keep it going.

Are you treating APIs as products?

What does that mean? If you start treating APIs as products, you can package them, set up quota limits and have pricing models. You can iterate on these, and eventually have revenue goals. 

The top quartile companies, as per the Apigee report, have four times more API products than organizations in the next quartile. 

What Do You Need for a Successful API Business?

Source: The State of APIs: 2017 Report: How APIs Power Digital Ecosystems

Do you have KPIs?

Do you have KPIs for the business success of your APIs? Have you defined what success means to your enterprise? What do you measure?

As it turns out, close to 60% of the top quartiles companies believe that the business success of the APIs is being measured. While in the next quartile it is in the region of about 30%. They measure metrics like direct or indirect revenue, and API consumption metrics like API traffic, the number of apps, and the number of active developers. 

What’s the focus on digital ecosystem capabilities?

The report says that successful companies have platform initiatives that enable developers and partners, connect apps, and devices, and innovate on business models. Among the top quartile companies in the Apigee Cloud, the largest push in the digital ecosystem is to connect or enable partners. The suggests that focus is not so much on immediate monetization, but on creating far more leverage through partners. Take a look.

Successful API Strategy Focus on Platform Initiatives

Source: The State of APIs: 2017 Report: How APIs Power Digital Ecosystems

How good are you with developer development?

Companies must focus on the set of users who will drive the uptake of the APIs, the developers. That seems like a no-brainer. But the data shows something else. The top quartile enterprises attract the lion’s share of developers (96.2%). That’s because they focus on them. They have outreach programs like hackathons. They have developer portals that allow easy discovery of APIs, enable secure self-service modes of consumption enables by interactive documentation. They have developer communities to foster connections and exchange so the ecosystem grows. 

It takes time and money. But isn’t that where the leverage is?

The State of APIs Report shares the best practices to enable your API business. How many of these are you doing well? And which ones do you need to work on?

The Leverage of Developer Portals

Srijan's API Management teams are equipped to implement your API strategy. If you already convinced about the need for an API-first strategy in place, and have a query on how to approach a developer portal, drop us a mail and we can get the conversation started.

Topics: API Management, Enterprises

How to Send Dynamic Auth Request with Postman in Drupal REST

Posted by Shamsher Alam on Sep 11, 2017 1:04:00 PM

RESTful is a wonderful little module that provides a solid object oriented base for implementing a REST API in Drupal. I have used both RESTful and services to create APIs and at the moment I prefer to work in RESTful – though the class based PHPoop approach is really vital to both. The maintainers are conscientious, in-tune with API best practices and write quality code. I encourage you to contribute to their project by reporting issues, contributing code in pull requests in GitHub and most importantly using this great module.

However, there are two issues that I have always faced with REST:

  • How do I send auth request in Drupal REST api?
  • How do I send user session with every authenticated web request in Postman tool?

Now, there are two ways to resolve these issues:

  • One is, we can use the drupal_http_request function to consume the data and use it. But that would require a lot of customizations and in the long run would be very difficult to maintain.
  • Alternatively, we can use the Postman tool auth request.

In this blog, I tried to put together the steps for the second solution. Here is how you can send dynamic session request for next authenticated request using the Postman test script:

Before we start, enable the following modules:

Image 1.png

  • Web Service - Handle all web service core and custom
  • Web Service Authentication – It enables to add the web service authentication request
  • Web Service Server – REST Server or XML-RPC server parser

Download Google Chrome Postman extension application.

For this purpose, I have used Drupal 7 and the Services module. The first step would be to download and install the Services module and enable the REST Server module that comes with it.

Step 1: Add service

To create a service, you have to navigate to Service UI (admin/structure/services), click "add service", and enable session authentication for a user request.

new_end_point.png

Step 2: Edit the Resources Page

The "Open Resources" page will show Drupal core default service list like node create, user, taxonomies and file creation. You can also create your own custom web services using service module API.

Now edit resources.

image 3.png

Resources are available in default setup where all resources come with the Services module. You can choose or enable any default services end point for accessing web request.

image 4.png

Edit response method and format after request

image 5.png

Step 3: Send Authenticated Request

Now time to check web services and send the authenticated request. (api/user/login)

image 6.png

Store user session value in a variable using Postman script under tests tab. Write Postman tests script before sending request because when you will send web request, so post script will run when you will get data and save session value from response. (See screenshot for reference)

Image 7.png

This is the code example of Postman script before sending web request, and store session value from the response.

image 8.png

Node creates or next web authenticated request from Postman and uses user session values. Follow these steps to send next authenticated request (see screenshot for reference).

image 9.png

JSON value format for sending node values with web request

image 10.png

Drupal node create with author information.

image 11.png

User logout and destroy Drupal session.

image 12.png

You can download sample Postman request from GitHub

If you found this helpful, you might want to check out our range of tech webinars as well.

Topics: Drupal, API Management

Why Enterprises need an API-first strategy

Posted by Gaurav Mishra on Aug 19, 2017 5:58:00 PM

Digital transformation has been the headline of enterprise growth strategies for a few years now. It means being able to fundamentally transform and strengthen certain aspects of your business to leverage an increasingly interconnected digital ecosystem. It involves reducing dependence on legacy systems, breaking them into smaller, decentralized services, and becoming lean and swift in the face of changing trends. 

Adopting an API-first strategy is one of the most convenient ways to achieve your digital transformation goals. This is because they help you avoid a complete dismantling of your existing IT infrastructure, which can prove to be a costly affair. Instead, APIs can become the new wrapper around your legacy systems, allowing them to interact with modern applications. It’s a layer that brokers access to your tech-stack and databases while offering you greater controls and security. 

Here’s a look at why you need an API strategy for your enterprise:


Enabling Omni-Channel Customer Experiences

The ability to offer integrated, omni-channel customer experiences is fast becoming a necessity for enterprises, especially in industries like retail, banking, healthcare, and travel. And APIs are the key technical elements that make this possible.

Everything the customer needs is made available on one platform, bundled as a series of microservices and accessible across multiple channels. Your customers can start their journey with a query over a chat interface that is seamlessly carried over to evaluating your product on the mobile app, to completing the purchase on your website payment gateway, and collecting their purchase from your physical store. 

Customer information is no longer tied down to a particular mode of interaction. It is accessible across multiple channels/devices via API calls, giving your customers the convenience of picking up and completing their buyer’s journey at any point. This means significantly lower drop-offs and higher conversions for your business.

Extracting Rich Customer Insights

Truly understanding your customers’ wants and needs is at the heart of driving successful business growth. And enterprise legacy systems have a ton of customer data stored away, just waiting to be leveraged. What you need are internal APIs that will allow your current business intelligence technology to communicate with your legacy systems to extract this data. 

At the other end of the spectrum, enterprises also use APIs that allow them to integrate different services at key points in the customer journey. This creates interaction points that allow you to collect new customer information. It could be a social media API, or a payment gateway integration, or even an internal software component that prompts users to share more information. 

There could be another set of APIs that bridge the gap between your data, and visualization and reporting dashboards, allowing you to manipulate and analyze this data at will, drawing customer insights that drive your strategy.


Reducing Time to Market

An API-first strategy entails a complete paradigm shift in how collaboration takes place within an enterprise. When all data and information between departments can be accessed via API calls, it eliminates long wait times and improves productivity. 

More importantly, internal APIs make it possible for your product teams to work faster. Separate teams can be simultaneously working on different aspects of the product, while seamlessly coordinating with each other via APIs. This, coupled with quick and standardized access to data due to APIs, lead to significantly faster time-to-market for new products and services.


Revolutionary start-ups today are going head-to-head with established enterprises, and coming out ahead in a lot of cases. These organizations are designed to offer a seamless, holistic customer experience right from the beginning, playing to their strengths of being agile and highly efficient. And global enterprises, despite having decades of experience, run the risk of being disrupted. 

The only way to win the disruption game is to leverage the digital ecosystem to deliver greater value to your customers, and do it fast. And adopting an API strategy and focussing on API Management is one of the most efficient ways to prepare your enterprise for this challenge. 

Topics: API Management, Enterprises

How to Parse JSON Data from a REST API using simple JSON Library

Posted by Nilanjana on Apr 15, 2016 4:11:00 PM

Let’s start by understanding what is a JSON based API. JSON (Java Script Object Notation) is a lightweight data interchange format that is now being used as a profound and efficient way of gathering, collecting or sharing data among applications and interfaces. JSON provides data to its corresponding calling function in key, value pairs. ‘Key’ as in the variable and ‘value’ as in the corresponding value for the variable. The data that is parsed from a JSON API is in the form of object which needs to be converted into their respective data format as acceptable by the system.

 

I won’t go into much details into describing API’s in this blog post( may be in my upcoming one). REST (REpresentational State Transfer) is an architectural style and is an approach to communicate between different modules that is often used in the development of web services. So in this blog I would describe how can you use JAVA to leverage JSON data from a REST API.

Before starting, here is the REST API I am using to parse data into my system JSON-API.

Now what is the use of parsing JSON data from a web service when I can have it in my system already ? The answer to this would be, now a days maximum of the client data is available over the web as it is not prone to data loss.  Moreover clients built around JSON API are able to take advantage of its features around efficiently caching responses, sometimes eliminating network requests entirely. So let’s proceed ahead and I would try to explain the process of parsing the data.

Step-1: 

Pass the desired URL as an object. So that would be likePass the desired URL as an object. So that would be like

Step-2: 

Type cast the URL object into a HttpURLConnection object. The benefit of doing it is that we would be able to harness the properties of the HttpURLConnection class to validate features. For example set the request type or check the status of the response code.Type cast the URL object into a HttpURLConnection object

Step-3: 

Set the request type as in whether the request to the API is a GET request or a POST request. Set the request type as in whether the request to the API is a GET request or a POST request.  

Step-4: 

Open a connection stream to the corresponding API.Open a connection stream to the corresponding API.  

Step-5: 

Get the corresponding response code.Get the corresponding response code.  

Step-6: 

Now I need to perform a check that if response code is not 200 then throw a runtime exception otherwise carry on the rest of the procedure. So the structure would be

 perform a check that if response code is not 200 then throw a runtime exception otherwise carry on the rest of the procedure.

Step-7: 

I have used the method scanner to read each line from the API and fetch the data in string format. Now this part is inside else { } that I mentioned above.

method scanner to read each line from the API and fetch the data in string format.

method scanner to read each line from the API and fetch the data in string format.

So the parsed data would something like this

Now you have all the data with you from the API. But somehow it looks a bit unstructured and definitely rather than the whole data you would need it categorically. So for this you need to parse this data into JSON object. In some cases you need to store the data in JSON array as well.

JAVA by default does not have any inbuilt class or provide any inbuilt class, method to parse and store these data as objects. So, for that you need the classJSONObject (to store the corresponding string data as JSON objects), JSONArray (to hold JSON objects in an array) and JSONParser (to convert string object into JSON objects). For that you will need a package called SimpleJSON. Download the required jar files and configure its class path in the system.

Step-8: 

Declare an instance of the JSONParser


Declare an instance of the JSONParser

Step-9: 

Convert the string objects into JSON objects.

JSONObject jobj = (JSONObject)parse.parse(inline);

So if you view the JSON structure which would be something like this

 Convert the string objects into JSON objects. JSONObject jobj = (JSONObject)parse.parse(inline); So if you view the JSON structure which would be something like this

I would now like to get the corresponding values under the results array. So here how you do it:

Step-10: 

First convert the JSON object into JSONArray object like this

 First convert the JSON object into JSONArray object like this  

Step-11: 

Once the JSON objects are stored in the array, read the corresponding JSONArray objects, convert it to JSON objects again. So you get the elements within the results array. So here is how you do it.
Once the JSON objects are stored in the array, read the corresponding JSONArray objects, convert it to JSON objects again. So you get the elements within the results array. So here is how you do it.

 

Once the JSON objects are stored in the array, read the corresponding JSONArray objects, convert it to JSON objects again. So you get the elements within the results array. So here is how you do it.

Once the JSON objects are stored in the array, read the corresponding JSONArray objects, convert it to JSON objects again. So you get the elements within the results array. So here is how you do it.

Let’s us dig a bit deeper. Suppose I want the components of “address_components”. Here is the JSON structure

So how would I get the components under the address_components array? Follow the same step as above

That's all I have about the subject, for more resources you can lookup the git hub link to help you out with Parsing Data from JSON REST API.

Topics: API Management, Coding and Tutorial

REST API and its utility in real Web Applications

Posted by Nilanjana on Apr 5, 2016 4:54:00 PM
Quick fact: REST stands for REpresentational State Transfer, now let’s find out what it actually does.

REST is a very popular architecture nowadays for development and is an approach to communications between two very different components that is often used in the development of Web Services. Besides, REST does not leverage much bandwidth which makes it a better fit for use over a network.

This makes REST a better fit over SOAP because unlike SOAP you do not have to create a server and a client. In case of SOAP you have to separately create a server program to serve data and a client program that would request the data.

REST’s decoupled architecture and lightweight communications between a producer and a consumer makes it popular to build APIs.

What does decoupled architecture mean? Decoupled architecture is a framework which allows two components to remain completely autonomous and unaware of each other. Each component works in its own style while an intermediary helps link the two components. This is what a REST api really helps in achieving when working on decoupled architecture. Basically, a REST api consists of some specific values that can be in a format of XML or JSON, depending on what the function or program returns when the API is called.

Let me briefly explain how a REST api works.

 
how a REST api works.

As you can see from the diagram we have two very different services serving two very different purposes. Front end service such as AngularJs, which is a very popular js framework used nowadays for web applications, needs to communicate with the back end services so that it can avail all the required details from the back end. This is how REST api comes into the picture.

REST api helps expose the business logic in the back end to the front end services. It would just give the front end service a required URI (for example localhost:8080/MyApplication/testapp/ftocservice) from which the front end service can fetch the required data. All that needs to be done is that backend logic should be exposed as URIs.

So to sum up, the advantages of using a REST api are as follows:

  • Decouples consumers and producers

  • Stateless existence, which means there is no record of previous interaction and each interaction request has to be handled based entirely on the information that comes with it

  • Can be leveraged when handling requests from multiple systems or components

  • Platform independent

  • Can be leveraged to process data in both XML and JSON format

  • Highly scalable and reduces server load making failover easy

These are the basics of REST API. Look out for my next blog on how can you expose business logic as a REST api and how can that REST api be leveraged.

Topics: Drupal, API Management, Architecture

Drive through Facet Search API

Posted by Nilanjana on Sep 16, 2015 4:17:00 PM

In my last blog, we discussed How to implement Facet Search on Data in Drupal 7. Through this blog I am going to drive you through certain scenarios we faced while working on one of our client projects and how did we got through it. The requirement was to build a similar search as per the below mockup.

Mockup

Mockup Specifics:

  1. Multiselect facet search
  2. Multiple content type should be searchable
  3. Share the search URL
  4. Toggles between gallery and list view without changing the search result
  5. Accordion on facet filters with managing the alphabetical order

So, let’s get started and check how we built these functionalities? What all challenges we faced? What all modules we used to reduce our effort?

First let’s get our modules

  1. Facet API 
  2. Search Facet API 
  3. Search Views
  4. Database Search
  5. Accordion mini panels  (For making the facet filter accordion)
  6. Panels and related dependencies

Other useful modules for different scenarios of search:

  1. Custom Search
  2. Solr Search
  3. Search API Exclude
  4. Date facet search
  5. Mini panel

Incase you don't know how to setup facet search using the Facet API etc, You can go through my previous blog.

Multiselect Facet Search:

In order to get the multi-select facets working we need Multiselect facet search module which gives us ‘AJAX multiple Checkboxes Display’ widget in Display setting.

Multiple content type needs to be searchable

Step 1: Instruct your search index to consider all the fields for indexing from the content types mentioned in the data source.

Step 2: Do tweaks in your search views. Let us say if we want to filter out the content of different content types with same facet filter, How are we going to do that?

Solution: We have to reuse the facet filter field in content type and add it to the view. We will see some real scenarios and solve them together with quick and simple solutions.

How to share AJAX facet search result URL?

We had the multiple select AJAX facet filters and our client wanted another feature, by using which, a user would be able to share the search URL with other users. We didn’t have the search query parameters in URL and no methods which can give us search URL directly in our custom module. After a bit of digging into AJAX facet module, we realized that all the search we do via AJAX,  is actually provided in.

“Drupal.settings.facetapi” and into that “Drupal.settings.facetapi.applyPath”

This solved our problem. We went ahead and created a dom text box and with little lines of jQuery we got the search URL dynamically, for a user to share.

Toggles between gallery and list view without changing the search result

We had two displays (Gallery and List) with the same search. So we made the search URL to persist when a user toggles between both the displays, using jQuery.

Accordion on facet filters with managing the alphabetical order

One can do this by writing some lines of jQuery and playing with DOM elements. But the question is do we have a simple way, and a solution which can also be used throughout the site without writing same line of codes and preventing the developer to do an OCD?

Yes, we do have a way of using, i.e the ‘Accodian mini panels’ module (https://www.drupal.org/project/panels_accordion)?

As we know that the facet API builds blocks every facet filter that we add to our search index.

Step 1: Create a mini-panel and add your facet filter block into it.

Step 2: Change the style setting of your mini-panel to Accordion.

Step 3: That’s it. Now add your mini panel to the panel page. You will have all the data associated to your facet block in accordionstyle.

 
In order to manage the alphabetical order of facet block data, we have to set the sort order in Facet block settings.

Thanks for reading! Please feel free to comment on anything you don’t understand or looking for in Faceted search implementation.

Topics: Drupal, API Management, Architecture

How to implement Facet Search on data in Drupal 7

Posted by Nilanjana on Sep 3, 2015 4:33:00 PM

If you are thinking about creating a website where you can show your big data, then with the help of facet search your website user can actually find specific data related to them. In this blog, I will help you in setting up Facet search functionality on your data in Drupal 7. 

The Faceted Search module provides a search API and a search interface for allowing users to browse content in such a way that they can rapidly get acquainted with the scope and nature of the content, and never get lost in the data. More than a search interface, this is an information navigation and discovery tool.

In order to make such functionality, you need to install some modules on your site. We will first make an  Indexing engine which will index all your data, and then we will make blocks of specific data which will allow you to filter all the related data to itself.

Modules to install for implementing Facet Search:

  1. Facet API
  2. Search API
  3. Database search
  4. Search Facets
  5. Search Views
  6. Entity API

Now that we are done with installing and enabling above modules, follow the below steps. Steps to follow:

 

  1. Create the content type and add fields in respective content type.

  2. Configure the search server

  3. configure the search index

  4. Add fields on in Facet API

  5. Create a complete view  of your data

Each step is explained below

Step 1. Create content type and add fields in that:

Let’s take an example that we created content type

  • Title: Company

  • Fields: Address

  • Fields: County

Now create content of above content type and add data into it.

Right now we have content with data into it, and also modules. Now we need to configure above modules as per our functionality on data.

Step 2. Configure the search server:

Go to configuration admin page (configuration/admin) in your Drupal 7 site and click on the search API in Search and metadata section. You should be now on Search configuration setting. We will create a search engine for our data. You should see page like below:

Configure the search server

Now click on Add server link. Give a name to your server I gave (MYSQL), Choose database service for your service class and click create a server. Your server should be like below.

 

Configure the search server

 

Step 3. Configure the search Index:

Now we will make our search index, which will index all data from using search server and database server. It will do indexing as the user search for data on site and give faster results. Go back to search API settings and click on Add Index link. You should be on below page now.Configure the search Index

Values for above form:

  • Index name: Business Information

  • Item type: Node

  • Server: MYSQL which you create earlier

  • Index items immediately: Checked

Click on create Index. Now we will select which field to be indexed from our data so we will select fields we want. In our case, we will select

  • content type

  • Address

  • Title

  • County

and click on save the configuration.

What is the outcome

we created our database server, Index server and added fields which need to be. As you added fields for indexing Facet API actually make Facet blocks of those fields.We will enable them later.

Now run Cron in your site which populate the Index.

Step 4. Create a view of your data which need to be Indexed and Displayed to your site user:

Install Views and enable it. Go to Structure > Views. click add a new view. Select below values for each field:

  • Show content: Business Information “This will be name of your Search server”

  • Create a page: checked

  • Path: node

  • Display format: Table

Your view information look like below:

Create a view of your data which need to be Indexed and Displayed to your site use

Click on continue & edit button. Now in the Fields section click on add fields and Filter Index node. Add Index fields you want to show to your user. Your selection will look like as below.

Create a view of your data which need to be Indexed and Displayed to your site use- 2

Complete all configuration of the specific field and click Apply Display. You are done with creating view. You are now able to see this view on your front page(/node).

Next step is to enable all blocks of your facet search. Earlier we added fields which needed to be Indexed. Actually when you add fields for indexing Facet API it creates Blocks of those fields respectively. You have to just enable them from Search settings.

Step 5. Enable Facet block from Search settings:

Go to configuration and click on Search API from search and metadata. Now just click on edit in You are able to see various configuration options like below.

Enable Facet block from Search setting

Click on Facets and enable facets you want. When you enable and save the configuration, it will create blocks of respective fields.

Step 6. Enable your Facet block from Blocks:

Now go to structures and blocks. Here you are able to see your block in Disable section just enable them in any regions of your theme.

Congratulations! Your site is ready. Visit your home page and it should look like as below. As you select options from blocks your main view shows you data as per your selection.

Note:-

Facet API have many configuration options. You should take a look to them like showing selection in Blocks in Checkbox etc. However, facet API is not able to give you Multiple Facet search functionality. So, I am now working on developing custom module of widget and behavior which will give functionality of Multiple facet selection search. Facet API have OR and AND but only AND works not OR among fields.

Read my next blog on How to Drive through certain scenarios while implementing Facet Search API.

Please free feel to ask your queries related to Facet search in the comment section below. 

Topics: Drupal, API Management, Coding and Tutorial

A new framework to test JSON APIs

Posted by Nilanjana on Apr 15, 2015 1:04:00 PM

QA at Srijan is exciting. There’s a lot to explore, freedom to implement and the taste of winning. It is awesome.

So far, API testing has involved manual efforts. Now, Srijan has come up with a completely different approach to test APIs by automating JSON API responses. But before jumping to how we did this, let’s backtrack a bit.

We came across a situation where we were required to do automaton of API testing. And we were wondering how to do it. Who would help us out? What would be the outcome? Would we be able to deliver the requirements? It didn't look terribly positive.

We started digging into it, discussed it for a few days, explored topics online, and exchanged ideas with peers within and outside the organization.

So, what was the outcome? We started drawing workflow diagrams on paper to kickstart this. We divided this problem statement into small chunks and started working step by step. This led us to the development of a framework that would help us do the required automation.

What have we achieved with our automation framework?

With this framework, we can

  1. Create content using APIs and verify it

  2. Create content using the UI (webdriver) and verify its response

  3. Capture the search API’s responses

We have more goals planned whose framework is still work in progress.

How did we achieve this?

We divided our framework into various sub-modules which can interact with each other. This block diagram will help you understand the modules of the framework and the workflow as well.                  

 

api_testing_2_0

XML:

This block works in parallel with the Java classes and maintains the sequence of capturing inputs from Excel. It also captures the JSON response, which is the API response. This was introduced so we could use the framework to its maximum extent with the least bit of coding.

Excel:

This includes the input for different variables to create content. It also serves the purpose of extracting expected results which will be compared with the JSON response later.

JSON Response:

We get different JSON responses after performing some actions. For example, create content using “create APIs”, search content using search APIs, the API’s response of contents created by UI, etc.

Java Classes: This serves the following purposes:

  1. Take input from Excel and process it

  2. Create the content and generate a JSON response

  3. Take the expected results from Excel and the actual results from the JSON response

  4. Processes Step "c", compares it and gives the outcome in form of Pass/Fail

Other features added to this framework:

  1. Clubbing of various JSON Objects or Excel variables to get single value responses. A user can also add separators in between the two key/field values to join fields on her own

  2. Deep digging into JSONs to get values for various keys

  3. Custom Authenticators that are required for creation of content

  4. Handling response from JSON Arrays

In the next blog, we will go deeper into the functionalities with some examples.

Topics: API Management, Framework and Libraries

Discussion

Write to us

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms Of Service apply. By submitting this form, you agree to our Privacy Policy.

See how our uniquely collaborative work style, can help you redesign your business.

Contact us