Exposing APIs from an app
One can add more APIs than what is defined as the default API for applications developed in Altinn Studio.
The applications that are developed in Altinn Studio are based on ASP.NET Core for back-end. This provides a highly flexible environment to change and modify the applications.
Adding an API-controller
To expose a new API to the application you have to add one or multiple API-controllers.
Below is an example from an API-controller which has been added to an app. This is where the API path listener is set up along with API logic.
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace Altinn.App.Api.Controllers
{
[ApiController]
[Route("{org}/{app}/CustomApi")]
public class CustomApiController : ControllerBase
{
[HttpGet("TimeInfo")]
public async Task<ActionResult> Get()
{
return Ok(DateTime.Now);
}
}
}

API respons
The code can be viewed in This repository.
You can read more details about the possibilities for exposing an API in the documentation for ASP.NET.