apigee getnextnumber api from a number range

Not applicable

We are planning to use APIGEE as an api layer for our mobile application. The backend data are held in various systems like, SAP, saleforce etc. We want to have an api getnextnumnber to return a next number on each call. And the number should be within a range. For example the number range is 100000000000-9999999999999. For example in first call the return value should be 100000000000 and in 2nd call the return value should be 100000000001 and so on. Is it possible in the apigee?

0 5 159
5 REPLIES 5

Not sure about apigee's any policy, but if you want the number increased on each request to API you can use BAAS.

Store the value say 100000 in bass collection. In your request flow make service callout to this value read that value add with your responce. Increase that value and make another callous to update that value in same flow.

Not applicable

Hi @Shihab,

Welcome to Apigee Community.

This functionality is like counter implementation. This can be implemented by storing current value in KVM and incrementing it every time.

For detail about KVM, ref the link: http://apigee.com/docs/api-services/reference/key-...

Cheers, Rajesh Doda

Hi, Thanks for your response. Will this KVM will reset any time? Like we restart the APIGEE. Can it be hold numeric like 100000000000-9999999999999. Can use this in the cloud version or it is only available in the BaaS?

KVM data is persistent so re-start of Edge won't have any effect on this data. This is available as part of the cloud version.

BaaS has data storage and the functionalities like push notifications, etc. Pl ref docs for detail:http://apigee.com/docs/api-baas

@Shihab , Check similar question asked here. Check @arghya das answer which explains maintaining counters using nodejs & redis.