Questions tagged [laminas-api-tools]

Laminas API Tools provides both a builder and PHP runtime for HTTP APIs, using standards such as Problem Details for HTTP APIs, OAuth2, Hypertext Application Language, and others.

Laminas API Tools, formerly Apigility, provides both a builder and PHP runtime for HTTP APIs, using standards such as Problem Details for HTTP APIs, OAuth2, Hypertext Application Language, and others. It is built on top of , and is a subproject of the project.

251 questions
373
votes
3 answers

How to define the basic HTTP authentication using cURL correctly?

I'm learning Apigility (Apigility docu -> REST Service Tutorial) and trying to send a POST request with basic authentication via cURL: $ curl -X POST -i -H "Content-Type: application/hal+json" -H "Authorization: Basic YXBpdXNlcjphcGlwd2Q="…
automatix
  • 14,018
  • 26
  • 105
  • 230
44
votes
5 answers

3rd party API gives back 500 error, what code should my API return

I've written an API in a framework based on ZF2 (Zend Framework 2) called Apigility. My Service can query 3rd party API's. Once in a while, I get back a 500 error message.. either due to expired tokens, or some such. How should MY API respond back…
Erik
  • 2,782
  • 3
  • 34
  • 64
21
votes
3 answers

Authenticate Angular js module for Apigility

I created an API using Apigility. I'm trying to set authentication system for a front end app that I'm currently building using the API. But all angular authentication modules that I have used for this authentication system were not matching with…
8
votes
1 answer

Apigility field accepting an array of embedded objects?

I'd like to create an Apigility REST service which accepts POSTs of, for example, a user object which has a field containing an array of address objects. I can define the field without validators and process the raw JSON in my code, but I'm…
marnusw
  • 855
  • 1
  • 9
  • 18
6
votes
2 answers

'Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.'

I have only upgraded to Laravel ^6.0 from 5.8*. On running $ composer require laravel/passport I have got error message "Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead." I have…
Steven
  • 1,071
  • 15
  • 15
5
votes
2 answers

Get current user information in Apigility Resource

I just started with Apigility and oAuth2, and I was wondering if it is possible to get the currently authenticated "loggedin" user when fetching information from a database. I currently have the following code: /** * Fetch all or a subset of…
5
votes
1 answer

Limit the results in Apigility

I created a code connected API with Apigility. For now I am using the standard create stubs. In my PostResource there is a method called fetchAll($params = array()). I created the code for the method so that it returns a paginatable set of…
Ikno0wit
  • 140
  • 7
5
votes
1 answer

Testing with OAuth2 and Postman

I am using ZF2 Apigility and am working on setting up an OAuth2 workflow for an API I am writing. So far I can get the following to work: Call the API and get a token { "access_token": "62f6109dcbce42b38f9117b21529faf30fc0ee86", "expires_in":…
HappyCoder
  • 5,985
  • 6
  • 42
  • 73
5
votes
1 answer

How to start using Doctrine 2 in an Apigility application with zf-apigility-doctrine?

I want to integrate the Doctrine 2 to an Apigility driven Zend Framework 2 application. So I installed zfcampus/zf-apigility-doctrine $ composer require zfcampus/zf-apigility-doctrine "~0.3" and activated the modules Phpro\DoctrineHydrationModule,…
automatix
  • 14,018
  • 26
  • 105
  • 230
5
votes
1 answer

Apigility child routes not getting parent parameters

I'm attempting to write a child route for an Apigility Service, and everything routes fine until it comes time to render the _self link.. GET http://host/api/service/parameter/gui/page { "status": 500, "title": "Unexpected error", …
Erik
  • 2,782
  • 3
  • 34
  • 64
4
votes
1 answer

How to check for oAuth2 scopes in Apigility?

I am creating an apigility project where we will be hosting all of our APIs. We need to be able to use OAuth2 for authentication but we cannot figure out how to control access to certain APIs, it seems like once a client authenticates, they can use…
Jeff Burgin
  • 175
  • 10
4
votes
1 answer

Error while generating a new service using "DB Connect" in Apigility

In Apigility admin I'm trying to generate a new service using the "DB Connected" option, but after load all tables of database, I choose one and click in "Create Service". I get a error in console as displayed in image bellow: Logs: [Error] Error:…
Alessandro Garcez
  • 728
  • 2
  • 6
  • 25
4
votes
3 answers

How to catch and log all exceptions in an Apigility ZF2 application?

I want to build an error handling & logging mecanism into an Apigility Zend Framework 2 aplication and catch & log all exceptions. After some research I found a Stack Overflow answer with a solution, that seemed exactly to meet this requirements.…
automatix
  • 14,018
  • 26
  • 105
  • 230
4
votes
1 answer

How to use multiple versions at the same time in an Apigility app with Doctrine?

Context first: Apigility driven application based on Zend Framework 2. In the first version (V1) I was using the ZfcBase DbMapper for the model layer. Now I'm implementing the V2 with Doctrine 2 as ORM. Apigility provides an easy switching between…
automatix
  • 14,018
  • 26
  • 105
  • 230
4
votes
1 answer

Apigility and oAuth for users

I'm about to start working on application with rest API and I want to use apigility. There is one problem unfortunately with this idea. I cannot find reliable source of information how to allow for authentication by oAuth for regular users. I need…
Adam
  • 873
  • 7
  • 33
1
2 3
16 17