Web Api

Using this new mode it is possible to integrate with Puship with greater security, using the new OpenID standard.

Puship supports two API authentication modes:

  • Machine 2 Machine
  • WebApp

The first is used when a connection is made directly from another server, the second is used when access is made from a website or a mobile app.

Here is an example of a call using the Machine 2 machine mode:

From the Puship dashboard, Client Secrets section, create a new Machine 2 Machine access key.

Using Postman we make a call to the permissions service to generate the access token

Now copy the generated token and go to swagger to test the API call, before making the call, click on Authorize and insert the generated token with the prefix “Bearer “

At this point we are logged in and can make calls to the API, in the following example the GetApps method is called to extract the list of user apps

The Api Puship are REST API, so it is possible to integrate them with any system, at this link you will find in-depth examples using the aso.net mvc technology.

To access the API in WebApp mode (ie using the Authorization Code Flow) it is advisable to use a support library, in the online example openIdDict was used.