GraphQL Error ClientID should be sent

I am following the Integrator’s GraphQL API Guide and I am getting {"error":"invalid_clientId","error_description":"ClientId should be sent."}

I am using SambaPOS 5.1.62. I’ve uninstalled and reinstalled both sql server 2016 express and sambapos. I also deleted any other databases I had just in case the graphql was looking to the wrong database. I am out of ideas on what to try to get this working. I seen someone else had the very same problem but just said he tried again but never gave any solutions to his problem. I turned firewall off, Opened port 9000 and tried it with firewall on. Below is my setup.


Identifier need to be graphiql you are missing i

Does the Identifier really matter?

Yes it does, if you want GraphQL to work properly :slight_smile:

So the Identifier has to be graphiql? What if you have more than one application. Surely they both cant be graphiql. In the tutorial the Identifier is pmpos?

More than 1 application can have a different identifier… For example, the android mobile app uses a different identifier to work with GQL and so does the Gloria Foods integration identifier. but both require the initial graphiql identifier to ensure it works.

No. Except …

The Identifier in SambaPOS configuration, which is the client_id in the Web App Auth routine, is only hard-coded in certain specific cases.

One such case is the GraphiQL interface (the GraphQL Interface you use in a Browser). It must be: graphiql.

Another case (I think) is the Android Mobile POS App. It must be: mobilepos

In all other cases, the Identifier is not specific to an App and it can be whatever you want it to be, because you can change the client_id in the App source code to match the Identifier that you set in SambaPOS.

PMPOS is no different. But the code must have the proper methods in place to actually send the client_id in the Auth routine; earlier versions did not have this. And in fact, that is the error that you are seeing - the client_id is not being sent from the Client …

{"error":"invalid_clientId","error_description":"ClientId should be sent."}

The same goes for Gloria Foods, though IIRC, the Auth routine for that code is setup properly.

Be sure to restart the Message Server Service after making modifications to Application in SambaPOS.

And if you make changes to source code, then you should do a Hard-reload of the page to ensure the code is updated in the Browser and not using cached code.

1 Like