Command 24 — Client searchrework
Two replacements, depending on what you were doing with it.
curl --location --request GET 'https://euapi.flowww.net/v1/fwa_external_get.asp?cmd=24&doctor=USER_LOGIN&pass=USER_PASS&country=ES&key=SYSTEM_KEY' \ --data-urlencode 'ClientNIF=00000000A' \ --data-urlencode 'ClientPhone=650000000' \ --data-urlencode 'ClientEMail=benito@perez.com' \ --data-urlencode 'ClinicID=1'V1 returned the clients whose NIF, phone and email were exactly the ones sent (all of them), in the ClinicID given, with no limit on the number of results.
Permissions
Section titled “Permissions”V2 checks an app permission on every call — V1 checked none — and a call whose permission is missing answers 400 with errorCode 15, the same status as an invalid payload (see 4.4). Grant these to the API user before porting the command; the names are the ones of the permission tree in flowww.
| Call | Permission |
|---|---|
POST /client/advanced-search | Clients → Advanced Search - Search |
GET /client | Clients → Clients - Search |
A. Simple lookup — GET /client?clientData=
Section titled “A. Simple lookup — GET /client?clientData=”One search term, matched against name and surnames or, when the term looks like one, against the email, NIF or phone number. This is the direct replacement for “is this person already registered?” — with the differences below.
curl --location 'https://api.flowww.net/v2/client?clientData=benito@perez.com' \ --header 'Authorization: Bearer <api_key>'[ { "ClientID": 93260, "ClientNumber": 93260, "ClientFullName": "Benito Perez", "ClientPhone1": "610000000", "ClientEmail": "benito@perez.com", "ClientClinicID": 2, "ClinicName": "…", "ClientLastPurchaseDate": "17/08/2014", "ClientLastSessionDate": "21/06/2021" }]Optional: phoneMatch=national (with phoneNationalDigits, default 9 for Spain) to require a full national-number match when the term is a phone.
| Topic | API V1 | API V2 |
|---|---|---|
| Criteria | NIF, phone and email at once, all of them must match. | One term. For several criteria at once, use the advanced search (B). |
| Matching | Exact. | Contains the term (see above). Use phoneMatch=national for phones. |
ClinicID | Filtered the results by clinic. | clinicID is the clinic the search runs from, not a filter. Which clients the API user can see depends on how the system scopes clients to clinics — see 4.10. |
| Number of results | All. | The first 50, with no paging. Refine the term if you get 50. |
| Nothing found | Empty list. | 404 (see the response mapping). |
B. Several criteria at once — POST /client/advanced-search
Section titled “B. Several criteria at once — POST /client/advanced-search”V1 let you send NIF and phone and email and returned the clients matching every condition. GET /client takes a single term, so an AND search moves to the advanced search, which combines the filters documented in its reference (identity and contact data, dates, clinics, referers…) plus Page for paging. Two of those filters take ids, not codes: ClientCountryID and ClientProvinceID — resolve them with the catalogues of 4.11.
Paging: Page starts at 0 and each page holds 50 clients. Stop when a page brings fewer than 50 clients; do not wait for an empty page. The advanced search is slower than the simple lookup on large systems: do not use it for “is this person registered?” checks.
curl --location 'https://api.flowww.net/v2/client/advanced-search?clinicID=1' \ --header 'Authorization: Bearer <api_key>' \ --header 'Content-Type: application/json' \ --data '{ "ClientName": "Benito", "ClientEmail": "benito@perez.com", "Page": 0 }'Response mapping
Section titled “Response mapping”| API V1 | API V2 (GET /client) |
|---|---|
ClientID, ClientNumber, ClientClinicID, ClientLastPurchaseDate, ClientLastSessionDate | same names |
| — | plus ClientFullName, ClientPhone1, ClientEmail, ClinicName and the ClientIncomplete / ClientDeferred / ClientInvestigate / ClientTMP flags |
empty <Clients></Clients> when nothing matches | 404 {"message": "No clients found for the provided search criteria."} — treat it as “not registered”, not as a failure |
Errors
Section titled “Errors”| Answer | Meaning | What to do |
|---|---|---|
| 404 | No client matches. | Treat it as “not registered”. |
400 375 | Empty search term. | Send a term. |
400 (errorCode 15) | The API user lacks Clients → Clients → Search (or Clients → Advanced search). | Grant the permission. |