Mock response

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:14:25 +0000.
Sender:Jayadatta Vallabhaneni.
Date:Thursday, 28 May 2015 19:24:55 UTC+1.

Hi Martin,

I am trying to mock a response for one of the API. Basically, it is a keyless api with version enabled, check marked the mock box and added a rest response to the body. However, i am not seeing it after saving either in the front end or in the tyk_apis collection for this API id. Do we have to use any other authentication method for this to work?

Thanks,
Jay

Imported Google Group message.
Sender:Martin Buhr.
Date:Thursday, 28 May 2015 19:46:30 UTC+1.

Hi Jay,

Yes, the only middleware that is enabled on an Open API is IP Whitelisting, Organisation Level quotas and Version checking.

Cheers,
Martin

  • show quoted text -

Imported Google Group message.
Sender:Jayadatta Vallabhaneni.
Date:Thursday, 28 May 2015 19:31:51 UTC+1.

Hi Jay,

Mocks only work on listed endpoints, as in, they are only triggered if the endpoint is either white listed, black listed or ignored.

I’d suggest adding it to the ignored list (white-list will disable all other endpoints as a wildcard).

Also, I just checked and mocks (and quite a few other middleware) are not supported in a keyless API, this is mainly because these middleware need a session object to operate correctly, and there is none for keyless APIs. So I suggest using basic auth or standard tokens if you are setting up a demo API

Thanks,
Martin

  • show quoted text -

  • show quoted text -

Imported Google Group message.
Sender:Martin Buhr.
Date:Thursday, 28 May 2015 19:35:16 UTC+1.

Thanks Martin for the quick response. Does adding the headers also work in the same way?

Regards,
Jayadatta

  • show quoted text -

Imported Google Group message.
Sender:Jayadatta Vallabhaneni.
Date:Thursday, 28 May 2015 19:46:30 UTC+1.

Hi Jay,

Yes, the only middleware that is enabled on an Open API is IP Whitelisting, Organisation Level quotas and Version checking.

Cheers,
Martin

  • show quoted text -

Imported Google Group message.
Sender:Martin Buhr.
Date:Thursday, 28 May 2015 20:00:15 UTC+1.

Thanks Martin.

On Thursday, May 28, 2015 at 11:46:30 AM UTC-7, Martin Buhr wrote:
Hi Jay,

Yes, the only middleware that is enabled on an Open API is IP Whitelisting, Organisation Level quotas and Version checking.

Cheers,
Martin

On Thursday, May 28, 2015 at 7:35:16 PM UTC+1, Jayadatta Vallabhaneni wrote:
Thanks Martin for the quick response. Does adding the headers also work in the same way?

Regards,
Jayadatta

On Thursday, May 28, 2015 at 11:31:51 AM UTC-7, Martin Buhr wrote:
Hi Jay,

Mocks only work on listed endpoints, as in, they are only triggered if the endpoint is either white listed, black listed or ignored.

I’d suggest adding it to the ignored list (white-list will disable all other endpoints as a wildcard).

Also, I just checked and mocks (and quite a few other middleware) are not supported in a keyless API, this is mainly because these middleware need a session object to operate correctly, and there is none for keyless APIs. So I suggest using basic auth or standard tokens if you are setting up a demo API

Thanks,
Martin

On Thursday, May 28, 2015 at 7:24:55 PM UTC+1, Jayadatta Vallabhaneni wrote:

Hi Martin,

I am trying to mock a response for one of the API. Basically, it is a keyless api with version enabled, check marked the mock box and added a rest response to the body. However, i am not seeing it after saving either in the front end or in the tyk_apis collection for this API id. Do we have to use any other authentication method for this to work?

Thanks,
Jay