Pando API
This repository contains Proto definitions for all Pando Public APIs.
The APIs are made available through gRPC or REST. They are secured by a JWT token from https://login.pandolink.com. API credentials are required to get a token; contact Pando if you wish to use our services.
Compiling with protoc
- First, download the protoc binary from the git repo. https://github.com/protocolbuffers/protobuf/releases/
- Second, createa a
Protoc
folder in the C:\Program Files
folder (or wherever you prefer).
- Third, move the files from the protoc zip to the
C:\Program Files\Protoc
folder.
- Fourth, add the
C:\Program Files\Protoc\bin
folder to your System Path.
- Fifth, create the
.out
directory in {public-api root}.
protoc
is dumb and won't create the directory for you.
- Use
'.out'
because .gitignore
will ignore it.
- Sixth, create directories in .out for the target languages you intend to compile.
- Again,
protoc
will not create these for you.
- Examples:
'.out\csharp'
, '.out\java'
, '.out\ruby'
- Seventh, execute the
protoc
command.
protoc --proto-path {path to public-api root} {desired output params} {proto file to compile}
Desired Output Parameters:
--csharp_out '.\.out\csharp'
--java_out '.\.out\java'
--ruby_out '.\.out\ruby'
--js_out '.\.out\js'
--cpp_out '.\.out\cpp'
--objc_out '.\.out\objc'
--php_out '.\.out\php'
--python_out '.\.out\python'
The above Output Parameters assume your working directory is {public-api root}
, typically C:\Code\public-api
.
Example:
-
Given {public-api root}
= C:\Code\public-api
-
To compile pando/api/tpv/survey/v2/media.proto
targeting C#, run this command:
protoc --proto_path "C:\Code\public-api" --csharp_out 'C:\Code\public-api\.out\csharp' C:\Code\public-api\pando\api\tpv\survey\v1\media.proto
-
If your working directory is already C:\Code\public-api
, you can run this shorter command:
protoc --proto_path . --csharp_out .\.out\csharp .\pando\api\tpv\survey\v1\media.proto
Compiling with protoc
with MacOS for Pando App
To build for the the React Native project Pando App, used the following commands in the following order in a bash shell from the public-api
folder:
-
Build the pando API
find pando -type d | xargs ./compile/grpcweb.sh
-
Build the google API
protoc -I=. --js_out=import_style=commonjs:./src/grpcweb --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:./src/grpcweb ./google/api/annotations.proto ./google/api/http.proto
The generated files will be placed in the public-api/src
folder.
Contact Info