Apps Developer Guide (Old)
  • Introduction
  • Create your first app in 4 easy steps
  • Overview
    • How does it work ?
    • Documentation
    • Deskpro Apps Tool
  • SDK
    • The Application Manifest
      • Manifest Reference
    • Storing data
      • Storing ticket data
    • Accessing the Deskpro REST API
    • Accessing remote services
    • The Application Installer
    • Application Contexts
      • ContextDataObject Reference
    • Events
  • Guides
    • Create an Oauth2 integration
    • Using an API Key to read data
  • Application Context
    • Get the authenticated user
    • Access Custom Fields
    • Interacting with the Host UI Container
  • Application Container
    • How do I badge my app icon
  • HTTP
    • How do I use a remote web service
  • OAuth2
    • How do I customize OAuth2 requests
  • UI Patterns
    • How do I split my app into different screens
Powered by GitBook
On this page
  1. SDK

Accessing the Deskpro REST API

PreviousStoring ticket dataNextAccessing remote services

Last updated 6 years ago

The Application Client provides an http client that your application can use to make requests to the Deskpro instance which is hosting the application.

The advantage of using the builtin client is that it saves you from worrying about the API authentication. The client will always use the credentials of the currently signed user.

How does it work?

You only need to obtain a reference to the from the Application Client. The following snippet will show you how to fetch the data for the signed in user

  // obtain a reference to the Custom Fields Client from the Application Context

  const { 
      /**
       * @see https://deskpro.github.io/apps-sdk-core/reference/DeskproAPIClient.html
       */
      restApi
  } = dpapp;

  restApi.get('me').then(response => console.log(response.body))

You don't need to specify the full URL of your resource, only the relative path. This client only supports the v2 API which you can inspect by going to the following url:

Rest API Client
http://{your-deskpro-instance}/api/v2/doc