I get an http 400 Bad Request from the message server.
The form fields in the request are…
grant_type: password
username: Administrator
password: 1234
client_id: graphql
client_secret: test
SambaPOS is set up with these parameters as per the turtoial. The turtoial is using version 5.1.62 and I am using version 5.2.3 and I don’t know if this would make a difference.
The content in the response is
{
“error”: “invalid_clientId”,
“error_description”: “ClientId should be sent.”
}
The client_id is the Application Identifier. Have you created an Application in SambaPOS? Create an application other than the “graphql” app (it should be used for GraphiQL only)
Are you sure you are using the Password and not the PIN? Only the Password will work, PINs do not.
I understand the MessagingServer must be restarted after User or Application changes in SambaPOS interface.
I am not sure exactly what you are referring to with the term “App”. Does an App only consist of the form fields that can be edited in SambaPOS Manage->Users->Applications->Add Application
or is there other code I need to write. Maybe some javascript?
Whatever you are using, Postman for testing, or in your Web Ordering system, you are working with an “App” that is trying to connect to SambaPOS, specifically to the Messaging Server.
Postman is good to test with, for your Authorization Login. After you get that working, yes you will need to write some Javascript into your Web system to get Authorized, and subsequently run GQL queries and mutations.
I think I understand. My “App” will be a windows service running on our web server. How do I get the Server:9000/token request to return an access token so I can access the graphql api?