Hi Community,
I built a tool to link multiple Revit models from ACC using Autodesk Platform Services (APS) and pyRevit.I’m currently using Postman for the authentication flow and get the access token but also trying to do this using the routes api.
I’ve successfully set up the server and endpoint (which is my callback url in the auth flow), tested printing out responses. But when APS sends the code for the access token through a query parameter, I just can’t seem to grab it through Routes. I’ve tried everything available on the request object (data, params, header) but everything returns empty.
Here is my startup.py script that I’m testing with:
from pyrevit import routes
api = routes.API("auth-api")
@api.route("/callback", methods=["GET"])
def get_code(request):
data = []
data.append(request.params)
data.append(request.headers)
data.append(request.data)
data.append(request.path)
return routes.make_response(data=data)
This is what I see when the endpoint is triggered.
I am not sure what I’m doing wrong … Any help or advice is appreciated.