URI: http://base_uri/customers/v1/validate/electoral_register/
Request Payload: customer.json (containing customer information)
Method Logic: Compares concatenation of name_1, name_2 and name_3 with concatenation of name details from electoral register for same ID Card.
Response Payload: response.json (the outcome)
But this immediately felt odd, and furthermore is breaching a basic principle of RESTful design due to 'validate' verb in the URI. Thing is...how would one do it? I want it to be different from a simple querying method which returns customer information...this thing is specifically checking whether the customer details match details in an external source.
Any thoughts?
Kind Regards,
David Captur
--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.
POST <base uri>/electoralRegisterValidations
Request:{ "firstName": "fred", "lastName" :"flintstone", "nationalID": "31GG56F5" }
Response:200
"Looks good”
Its true that the API is probably safe, but I doubt its idempotent.
In my experience you often have to pay for these kind of checks, i.e. each time you call the API, you pay, That means the API call is not idempotent, since each call is either deducting an amount from your balance or creating a new line item which you will be invoiced for, etc. Hence POST.
I'm favouring this approach, specifically, the base_uri/validate approach. However, I was thinking of altering it a bit such that the payload would contain the entity to validate and I'd use the parameters control layers of validation.
But the entity is pretty large...I would end-up having a huge a URL riddled with parameters...is that really preferable?