Know about API Development

What is API?

Application Programming Interface (API) is a set of requirements, instructions, and standards that allow an application to employ services or features of some other device, application, or platform for providing better services.

Technically speaking, it happens to be a collection of programming codes that enables data transmission between one particular software product with another. It likewise comprises terms of this data exchange.

Application programming interfaces have a couple of components:

Technical specification depicting data exchange options between solutions having specifications performed as data delivery protocols.

Application interface written to the specification representing it.

In this, the application requiring access functionality or information from software calls its API, denoting the specifications as to how the data or the functionality should be provided. The other application just returns data functionality as demanded by the previous application. API likewise denotes the interface using which both applications communicate.

Every API is executed by function calls, which happen to be the language statements used to request software to perform specific actions and services. Functions calls are phrases that consist of verbs and nouns. Function calls are likewise mentioned in the API documentation.

APIs can serve several purposes. In general, they will be able to simplify or speed up application development. Developers make use of APIs for adding functionality to the present solutions from other providers. Moreover, one can also use them for developing new applications by making use of third-party providers.

Terminology

APIs are essential for developing mobile apps. For example, iOS and Android APIs enable native apps to access built-in features of devices. Consequently, here we have mentioned some terms that you need to comprehend before looking at the significance of API development.

  1. API key

An API key happens to be a code that approves an API request via a parameter or header.

  1. Endpoint

In an interaction between 2 systems using APIs, one end of the channel has been branded Endpoint.

  1. JSON

JSON happens to be an abbreviation for JavaScript Object Notion. Being a data format, it is employed for API response body and request parameters.

  1. Get

It is the HTTP method of the RESTful API for safeguarding resources.

  1. Post

It is how the HTTP method of RESTful API enables resource building.

  1. Oauth

Oauth is an abbreviation for Open standard Authorization framework that allows access from the user’s side without sharing any credential.

  1. Rest

REST (Representational State Transfer) is a kind of architectural implementation for improving communication between various applications. It is based on the concept of making particular info obtainable only when requested via references, rather than an entire copy of the information. World Wide Web happens to be an example of those systems which follow this architecture, and these are known as RESTful systems.

  1. Soap

SOAP is an abbreviation for Simple Object Access Protocol. This messaging protocol works with application layer protocols such as SMTP and HTTP, and XML information set for message formatting plus transmission and negotiation.

  1. Latency

Latency happens to be the time consumed by an API for processing the request into a response.

  1. Rate-limiting

API rate-limiting is considered to be the procedure of identifying the rate at which a user accesses APIs. That is to say, it limits the number of requests to an API per time.

  1. API throttling

Throttling is referred to as regulating the usage of API every user at a particular time. It takes place when a user exceeds the limit of API requests each day, and the server delivers a message as HTTP status asserting “too many requests.”

Let’s know here How does API work?: https://www.rlogical.com/blog/api-development-complete-guide-to-building-robust-apis/

#api #rest #json #microservices #postman #serverless

What is GEEK

Buddha Community

Know about API Development
Marcelle  Smith

Marcelle Smith

1598437740

A Simple Guide to API Development Tools

APIs can be as simple as 1 endpoint for use by 100s of users or as complex as the AWS APIs with 1000s of endpoints and 100s of thousands of users. Building them can mean spending a couple of hours using a low-code platform or months of work using a multitude of tools. Hosting them can be as simple as using one platform that does everything we need or as complex as setting up and managing ingress control, security, caching, failover, metrics, scaling etc.

What they all have in common are three basic steps to go from nothing to a running API.

Each of these steps has its own set of tools. Here are some I’ve used and popular alternatives.

Design

REST is the most popular API interface and has the best tooling. Our design output for REST services always includes an OpenAPI specification. The specification language can be tricky to get right in JSON (how many curly brackets?) or YAML (how many spaces?) so a good editor saves a lot of time.

Four popular ones are:

I’ve only used Swagger and Postman but both Insomnia and Stoplight look interesting. All of them offer additional functionality like documentation, testing and collaboration so are much more than just specification generators.

#api #apis #api-development #restful-api #rest-api #development-tools #app-development-tools #developer-tools

Tracking a Developer’s Journey From Documentation Visit

If your business model involves selling to developers, you probably have already realized that much of the traditional processes and metrics applicable to traditional enterprise sales or consumer marketing don’t work. Specifically, selling to developers usually means attracting them to your platform and helping them succeed in building something, whether that’s a new app, integration, or automating an internal process. Getting developers to adopt your platform can be daunting and requires investment in product, onboarding and developer experience, and documentation. However, there are few tools product managers and developer relations leaders can leverage to measure and improve that experience.

Web and mobile analytics tools like Mixpanel and Amplitude can only measure activity on the website itself, yet most developer platforms price on what happens with the API, not via website activity. On the other hand, most API monitoring tools can only track infrastructure metrics like requests per minute and CPU utilization without any context of the user. To accurately measure your adoption and conversion funnel, you need to track usage across your entire platform from initial ad click and sign up, to what a new developer does with your API.

What is the developer-first marketing strategy

Most developer-first platforms have a B2D (business2developer) go to market strategy which is uniquely different from B2C companies which drive consumer adoption, but also different from B2B companies who maintain large sales forces to push their solution to other businesses. In reality, B2D sits somewhere in the middle between B2B and B2C.

B2D is like B2C in that:

  • Self-service signups and credit card payments takes priority over sales demos and contract negotiation
  • Low-cost acquisition channels like SEO-optimized content, SEM, and partnerships are prioritized over large and expensive sales development teams sending emails.
  • Because almost everything is self-serve and online, you can be very data-driven in terms of product metrics focused over just focusing on 1:1 relationships.

B2D is also like B2B in that:

  • The developer still works at a company who is buying to solve a pain rather than an individual looking for the latest gadget or online hangout spot.
  • Sales processes can still be complex involving multiple stakeholders and require technical validation.
  • Developers are still humans implementing a complex solution and may need high-touch dedicated support vs B2C where support is super transactional handling password resets and returns.

Building a cross-platform funnel across web and API

API product managers can focus on any number of initiatives at any given time, whether that;s API features, pricing and packaging, or top of the funnel acquisition. In order to know which area to focus, you should map out your _entire_funnel from very first ad click to a fully activated customer paying and referring other customers. The beginning of your funnel might start on your website as a visitor signs up to use your API. However, once they created an API key, much of the magic happens on the API side rather than the web side. Many developer platforms build their business model around usage-based pricing, which means your revenue is correlated to API usage, not website usage.

Funnel StageSourceDescriptionWhat to look forSigned UpWebsiteThe first step a developer makes is to show interest in your platform. For developer tools, this usually means signing up and generating an API key.Your analytics solution should be tracking which channel the user came from using UTM parameters, referrer tracking, etc along with which page drove the signup.Made first API CallAPIThis is a huge milestone as many signups never reach this stage. The developer was able to understand your API and give it a spin.Monitor TTFHW (Time to First Hello World) and conversion rate. You should continue looking at which channels drive the most activations.Made over 100 API CallsAPIAfter a 100 or so API calls, you could consider the developer “active”, in that they built a real integration rather than just testing with Postman or CurlA low conversion rate from the last step could imply difficulties with your SDK or unclear integration steps.Approaching Free LimitsAPIMost API products are priced on usage. In order to become a paying customer, they need to exceed some limit.If very few long-term “active” developers exceed their limits,then you may need to optimize your packaging and pricing.Converted to PayingWebsiteCongrats! You now have paying customers.Most developers have more than one value metric they price on. Keep an eye on which ones are driving paid conversions.Evangelized your APIWebsiteAre developers sharing and discussing your platform online?By adding a mechanism to track referrals, you can see which channels and mediums are performing the best. A complete analytics platform can track UTM parameters and things like referring domain. With a mechanism to generate unique links pere customer, you can also track which types of customers share the most.

API Adoption Funnel

Linking web with API activity for users and companies

Business2developer go to market models have elements of both B2C and B2B and involve both individual developers and also companies or accounts. It also involves cross-platform tracking across web and APIs. This can complicate accurate funnel and conversion reporting. Do you track an individual user sign up funnel or do you track companies who integrated and use the API? What happens if a developer clicks on an AdWord and signs up using his or her GitHub account but doesn’t do anything. If the person invited a colleague to do integration, then that person may only be attributed to “direct traffic” or “invite referral” depending on your marketing attribution. We need to still attribute the successful integration to an AdWord click.

One way to solve this is mapping out a 4x4 grid to track:

Developers active on APICompanies active on APIDevelopers active on websiteCompanies active on website

Not all API platforms will follow this model and may fill some boxes with a don’t care. For example, many APIs don’t care or track which developer is accessing the API, yet it’s important to understand which company is using the API. In this case, we want to track the following:

_Not Applicable_Companies active on APIDevelopers active on websiteCompanies active on website

Solving the cross-platform tracking

In order to solve this, analytics platforms like Moesif link everything through user ids and company ids regardless of the sessions. Your API and website should use the same identities regardless of the platform for accurate reporting. By modeling companies as groups of users, the linking can be simplified. This provides flexibility in picking and choosing whether to track usage only at the user-level, only at the company-level, or both for the API and website separately.

While having permanent identifiers are great, sometimes we don’t have all information available when the API call or user action is logged. To solve for these cases, we leverage the website session token or API key to uniquely identify the person and company. An alias table that links both session tokens to user/company ids and also API keys to user/company ids enable end to end funnel tracking.

Closing thoughts

Tracking usage and retention accurately is critical in 2020 as leadership shifts from a growth at all costs to efficient growth driven from product optimizations. You can no longer just measure vanity metrics like pageviews and signups. Instead, you should be measuring the entire funnel and understand the inputs that impact each stage. How does changes to your pricing and packaging modify your conversion rates from active developer to converted paying customer.

#api management #developer marketing #developer relations #developer experience #api adoption #developer advocacy #developer advocate #api product #api program #developer evangelism

How to Market to Developers with Paid Marketing

At Moesif, we primarily market to developers and other technical audiences like product managers and developer relations teams looking to make their own developer platform successful. Getting developers to adopt your API or tool is hard and requires heavy investment in experimentation and measurement in order to achieve the results you’re looking for. At the same time, much of the online advice you hear for B2C or B2B marketing simply won’t work when marketing to developers. This article outlines much of the findings we’ve seen as we grew Moesif from 0 to now over 5,000 companies including Deloitte, UPS, and Radar.

What makes developer marketing hard

Before jumping into things you should be trying, let’s review what’s so special and hard about marketing to developers. Most developer-focused companies are founded and led by developers themselves, so you would think figuring out things like product marketing should be easy right? After all, you’re just marketing to yourselves. Just like any audience, there is no single developer persona.

Accurate measurement is difficult

Fast and iterative experimentation is critical to recoup any investment in paid ads. If you’re not diligently tracking your metrics, you can easily run up your cost per acquisition (CPA). However, what do you actually measure against for a developer tools company? Accurate attribution can be complicated since for many developer-tools, the majority of the value and magic your product creates is via an API or integration, not via a mobile or web app. This means a user who signed up and clicked around your website isn’t necessarily a converted user. Yet, there is some intent based on the content or areas of the product a user is looking at. For most developer-first companies, we recommend looking at a metric such as developers who made their first API call. Later, you can define additional funnel stages such as developers who made more than X transactions through your API or developers who used Y different features. Additional complication comes from attributing back to the marketing channel since now you have to instrument both your website to track the acquisition channels a developer went through and then linking that to what the developer did with your API.

Targeting is hard

Most social ad networks are designed to target general consumers based on personal demographic data, not developers. You can target consumers with these networks with simple Yes or No filtering. Such as Does the person live in San Francisco or Is the person aged between 18 and 24 years old. This means if you’re a pizza shop in San Francisco, it’s relatively easy to set up Facebook ads to target college students aged 18 to 24 who live in or around San Francisco. This demographic may be ideal late nite pizza customers.

For developer’s there is no single “is developer” demographic that can be answered via a simple Yes or No question. You could attempt something like _Is their college degree Computer Science”, but software engineering is a career with a variety of educational paths and does not always require a computer science degree. Even if you could match on a person’s title, software engineering is an ambiguous role with varying responsibilities. Some engineering develop embedded systems for cars and drones, some software engineers are focused on building internal data analytics infrastructure, others are integrating billing APIs.

Many developer tools are in horizontal markets targeting a variety of markets rather than singling out a specific industry, but they solve a specific problem. Like enterprise sales, this means you need to target the right developer who will have a use for your devtool and champion it internally.

  • If you’re building a billing API, you need to target the guru in charge of billing infrastructure
  • If you’re building analytics tools, you need to target the product manager or engineering manager that’s the de facto analytics expert
  • If you’re building a new tool for docker, you need to target the devops master who happens to also be a Linux master.

Many stakeholders

The art of selling to developers is similar to most complex enterprise sales processes which have a multitude of stakeholders involved. For devtools, the number of stakeholders can be even more than traditional SaaS since you may have architecture review, security sign off, implementation, etc. This is because many times developers are checking out your tool or product for a corporation, not just for themselves. Handling these complications can be rolled into your marketing plan, rather than waiting until last minute objection handling.

Developers are skeptical

Technical audiences are by nature skeptical. They love to build things, not buy services. This creates inherent biases as they are exposed to third party solutions. Due to internal political struggles, some developers may have resentment or bias against sales and marketing teams. This makes direct outreach less effective. While it does work for certain top-down sales strategies such as for selling security software to CISOs, many devtools are trying to get an individual developer to first adopt the tool and then grow from there.

Paid inbound marketing

One of the most effective ways to attract developers to your platform (rather than filling their email box) is with inbound marketing. Inbound marketing is the art of attracting or pulling in developers to adopt your platform rather than forcibly pushing your platform on to them. There are a variety of techniques for inbound marketing from SEO to referrals, but the focus of this article is paid ads.

Why is inbound great for developers

As mentioned, developers are usually skeptical of traditional marketing activities. Whether this is an email from a SDR that is two paragraphs too long or a huge banner that says “Sign up now.” Being numbers-driven, they would rather cut through the bullshit and explore how something works themselves rather than be told how something works by a non-technical person. Developers also love to tinker and discover. That feeling of discovery though is a strong emotion. Think of the last time you discovered some new life hack or website that became your favorite and told your friends. That’s what inbound marketing leverages.

Effectively inbound marketing makes it appear that the developer discovered a new tool or platform on their own when in fact they were marketed to.

How to do inbound marketing with paid advertising

When done right, paid ads can drive adoption with low acquisition cost, but it requires much more planning and support than simply dumping a bucket of money on Facebook ads. If done incorrectly, you’ll still be pushing your product. The key is to be natural.

First you should decide on the goals of these initiatives, such as:

  • Brand exposure and driving traffic
  • Creating new leads and developer signups
  • Pushing existing leads to integrate your APIs
  • Converting developers to pay or have a larger deployment

Once you have your core objectives, you can lay out a content strategy to be used for social ads just like you would create a SEO strategy and keyword planner. Content is the number one item that makes your ads appear inbound. Content should be genuine and interesting to developers, but still relatable to the specific pain your tool solves.

It’s a fine line how specific you want to be. If you go too broad, then you’re not really pulling in the right developers that would adopt your solution. You can’t push out content that tells a developer to sign up when they don’t yet recognize they even have a problem. The way to solve for this is mapping the above goals to content that targets various stages of buying funnel:

Awareness/Exposure

Creating qualified leads

  • Thought leadership content/make yourself the domain expert
  • Why buy into the thesis/idea/product you’re solving. Still not about your company, rather just the problem/solution

Considering your product

  • Results and benchmarks from using your solution, technical whitepapers
  • Case studies and Comparison charts

#developer marketing #api best practices #developer relations #api adoption #developer advocacy #developer advocate #api product #api evangelist #api program #developer journey

Autumn  Blick

Autumn Blick

1601381326

Public ASX100 APIs: The Essential List

We’ve conducted some initial research into the public APIs of the ASX100 because we regularly have conversations about what others are doing with their APIs and what best practices look like. Being able to point to good local examples and explain what is happening in Australia is a key part of this conversation.

Method

The method used for this initial research was to obtain a list of the ASX100 (as of 18 September 2020). Then work through each company looking at the following:

  1. Whether the company had a public API: this was found by googling “[company name] API” and “[company name] API developer” and “[company name] developer portal”. Sometimes the company’s website was navigated or searched.
  2. Some data points about the API were noted, such as the URL of the portal/documentation and the method they used to publish the API (portal, documentation, web page).
  3. Observations were recorded that piqued the interest of the researchers (you will find these below).
  4. Other notes were made to support future research.
  5. You will find a summary of the data in the infographic below.

Data

With regards to how the APIs are shared:

#api #api-development #api-analytics #apis #api-integration #api-testing #api-security #api-gateway

Top 10 API Security Threats Every API Team Should Know

As more and more data is exposed via APIs either as API-first companies or for the explosion of single page apps/JAMStack, API security can no longer be an afterthought. The hard part about APIs is that it provides direct access to large amounts of data while bypassing browser precautions. Instead of worrying about SQL injection and XSS issues, you should be concerned about the bad actor who was able to paginate through all your customer records and their data.

Typical prevention mechanisms like Captchas and browser fingerprinting won’t work since APIs by design need to handle a very large number of API accesses even by a single customer. So where do you start? The first thing is to put yourself in the shoes of a hacker and then instrument your APIs to detect and block common attacks along with unknown unknowns for zero-day exploits. Some of these are on the OWASP Security API list, but not all.

Insecure pagination and resource limits

Most APIs provide access to resources that are lists of entities such as /users or /widgets. A client such as a browser would typically filter and paginate through this list to limit the number items returned to a client like so:

First Call: GET /items?skip=0&take=10 
Second Call: GET /items?skip=10&take=10

However, if that entity has any PII or other information, then a hacker could scrape that endpoint to get a dump of all entities in your database. This could be most dangerous if those entities accidently exposed PII or other sensitive information, but could also be dangerous in providing competitors or others with adoption and usage stats for your business or provide scammers with a way to get large email lists. See how Venmo data was scraped

A naive protection mechanism would be to check the take count and throw an error if greater than 100 or 1000. The problem with this is two-fold:

  1. For data APIs, legitimate customers may need to fetch and sync a large number of records such as via cron jobs. Artificially small pagination limits can force your API to be very chatty decreasing overall throughput. Max limits are to ensure memory and scalability requirements are met (and prevent certain DDoS attacks), not to guarantee security.
  2. This offers zero protection to a hacker that writes a simple script that sleeps a random delay between repeated accesses.
skip = 0
while True:    response = requests.post('https://api.acmeinc.com/widgets?take=10&skip=' + skip),                      headers={'Authorization': 'Bearer' + ' ' + sys.argv[1]})    print("Fetched 10 items")    sleep(randint(100,1000))    skip += 10

How to secure against pagination attacks

To secure against pagination attacks, you should track how many items of a single resource are accessed within a certain time period for each user or API key rather than just at the request level. By tracking API resource access at the user level, you can block a user or API key once they hit a threshold such as “touched 1,000,000 items in a one hour period”. This is dependent on your API use case and can even be dependent on their subscription with you. Like a Captcha, this can slow down the speed that a hacker can exploit your API, like a Captcha if they have to create a new user account manually to create a new API key.

Insecure API key generation

Most APIs are protected by some sort of API key or JWT (JSON Web Token). This provides a natural way to track and protect your API as API security tools can detect abnormal API behavior and block access to an API key automatically. However, hackers will want to outsmart these mechanisms by generating and using a large pool of API keys from a large number of users just like a web hacker would use a large pool of IP addresses to circumvent DDoS protection.

How to secure against API key pools

The easiest way to secure against these types of attacks is by requiring a human to sign up for your service and generate API keys. Bot traffic can be prevented with things like Captcha and 2-Factor Authentication. Unless there is a legitimate business case, new users who sign up for your service should not have the ability to generate API keys programmatically. Instead, only trusted customers should have the ability to generate API keys programmatically. Go one step further and ensure any anomaly detection for abnormal behavior is done at the user and account level, not just for each API key.

Accidental key exposure

APIs are used in a way that increases the probability credentials are leaked:

  1. APIs are expected to be accessed over indefinite time periods, which increases the probability that a hacker obtains a valid API key that’s not expired. You save that API key in a server environment variable and forget about it. This is a drastic contrast to a user logging into an interactive website where the session expires after a short duration.
  2. The consumer of an API has direct access to the credentials such as when debugging via Postman or CURL. It only takes a single developer to accidently copy/pastes the CURL command containing the API key into a public forum like in GitHub Issues or Stack Overflow.
  3. API keys are usually bearer tokens without requiring any other identifying information. APIs cannot leverage things like one-time use tokens or 2-factor authentication.

If a key is exposed due to user error, one may think you as the API provider has any blame. However, security is all about reducing surface area and risk. Treat your customer data as if it’s your own and help them by adding guards that prevent accidental key exposure.

How to prevent accidental key exposure

The easiest way to prevent key exposure is by leveraging two tokens rather than one. A refresh token is stored as an environment variable and can only be used to generate short lived access tokens. Unlike the refresh token, these short lived tokens can access the resources, but are time limited such as in hours or days.

The customer will store the refresh token with other API keys. Then your SDK will generate access tokens on SDK init or when the last access token expires. If a CURL command gets pasted into a GitHub issue, then a hacker would need to use it within hours reducing the attack vector (unless it was the actual refresh token which is low probability)

Exposure to DDoS attacks

APIs open up entirely new business models where customers can access your API platform programmatically. However, this can make DDoS protection tricky. Most DDoS protection is designed to absorb and reject a large number of requests from bad actors during DDoS attacks but still need to let the good ones through. This requires fingerprinting the HTTP requests to check against what looks like bot traffic. This is much harder for API products as all traffic looks like bot traffic and is not coming from a browser where things like cookies are present.

Stopping DDoS attacks

The magical part about APIs is almost every access requires an API Key. If a request doesn’t have an API key, you can automatically reject it which is lightweight on your servers (Ensure authentication is short circuited very early before later middleware like request JSON parsing). So then how do you handle authenticated requests? The easiest is to leverage rate limit counters for each API key such as to handle X requests per minute and reject those above the threshold with a 429 HTTP response. There are a variety of algorithms to do this such as leaky bucket and fixed window counters.

Incorrect server security

APIs are no different than web servers when it comes to good server hygiene. Data can be leaked due to misconfigured SSL certificate or allowing non-HTTPS traffic. For modern applications, there is very little reason to accept non-HTTPS requests, but a customer could mistakenly issue a non HTTP request from their application or CURL exposing the API key. APIs do not have the protection of a browser so things like HSTS or redirect to HTTPS offer no protection.

How to ensure proper SSL

Test your SSL implementation over at Qualys SSL Test or similar tool. You should also block all non-HTTP requests which can be done within your load balancer. You should also remove any HTTP headers scrub any error messages that leak implementation details. If your API is used only by your own apps or can only be accessed server-side, then review Authoritative guide to Cross-Origin Resource Sharing for REST APIs

Incorrect caching headers

APIs provide access to dynamic data that’s scoped to each API key. Any caching implementation should have the ability to scope to an API key to prevent cross-pollution. Even if you don’t cache anything in your infrastructure, you could expose your customers to security holes. If a customer with a proxy server was using multiple API keys such as one for development and one for production, then they could see cross-pollinated data.

#api management #api security #api best practices #api providers #security analytics #api management policies #api access tokens #api access #api security risks #api access keys