Call the service with grpcurl or Postman
Both tools discover the service through server reflection: no code generation is needed.
grpcurl
Section titled “grpcurl”Install grpcurl, then list the services and describe one:
grpcurl synchro.api.external-integration.ubikap.dev:443 listgrpcurl synchro.api.external-integration.ubikap.dev:443 describe services.synchronization.v1.SynchronizationServiceLog in — LogIn needs no token:
grpcurl -d '{ "officeScope": { "target": { "office": { "externalId": "12345" } } }, "userUuid": "01920000-0000-7000-8000-000000000000", "userCode": "12345678"}' synchro.api.external-integration.ubikap.dev:443 services.authentication.v1.AuthenticationService/LogInThen send the token in the authorization metadata:
TOKEN='<token returned by LogIn>'
grpcurl -H "authorization: Bearer $TOKEN" -d '{ "tasks": [ { "synchronizeFullWorkspace": { "target": { "workspace": { "externalId": "4242" } }, "source": { "credential": { "externalId": "67890" } } } } ]}' synchro.api.external-integration.ubikap.dev:443 services.synchronization.v1.SynchronizationService/PostAsyncTasks
grpcurl -H "authorization: Bearer $TOKEN" -d '{ "synchronizationId": "<synchronizationId returned above>" }' \ synchro.api.external-integration.ubikap.dev:443 services.synchronization.v1.SynchronizationService/GetSynchroStateAdd -max-time 30 to give the call a deadline. The API reference shows a ready-to-edit grpcurl command for every RPC: pick grpcurl in its client list.
Without reflection
Section titled “Without reflection”To work from the proto files instead, compile them with their dependencies into a descriptor set, and give it to grpcurl:
cd ubikap-synchro-service-protobuf build -o ubikap-synchro-service.protosetgrpcurl -protoset ubikap-synchro-service.protoset synchro.api.external-integration.ubikap.dev:443 listPostman
Section titled “Postman”- New › gRPC, and enter
synchro.api.external-integration.ubikap.dev:443as the server URL. - Click the lock icon next to the URL to enable TLS.
- In Service definition, choose Using server reflection — or import the
.protofiles of the archive. - Pick a method, e.g.
AuthenticationService / LogIn, and click Generate example message to fill the message as JSON. - For every method but
LogIn, open the Metadata tab and add the keyauthorizationwith the valueBearer <token>. - Click Invoke. An error shows its status code and message.