0

How do I map a page URL to Project ID?

Is it somehow possible to map a pages URL to a project id and vice versa via the shotgun-API? We want to embed Shotgun in another application and would like to track navigation in the shotgun-application.

For example the "Dashboard"-Page has an url like https://somebody.shotgunstudio.com/detail/Project/12 so the id is easily extractable and the url can be easily created out of an url.

But other pages such as the "Notes"-page or the "Sequences"-page has an URL of the form https://somebody.shotgunstudio.com/page/123 . This ID is different for every project, so theoretically there could be a possibility to retrieve the corresponding projectid.

thanks in advance

3 comments

  • 0
    Avatar
    Thomas Bach

    oh, just found that there is a page-entity. This was exactly what i needed here.

  • 0
    Avatar
    KP

    Yes, you can use the API to query Shotgun about the Page if you know the Page id and choose to return the project field.

    results = sg.find('Page',filters=[['id','is',123]], fields=['project'])

    Will return something like:

    [{'id': 123,
      'project': {'id': 4, 'name': 'My Project', 'type': 'Project'},
      'type': 'Page'}]
  • 0
    Avatar
    Andrew

    This isn't well documented, and I see you already have your answer, but in case anyone else is looking for the solution, you can always do this:

    https://yourstudio.shotgunstudio.com/detail/[Entity Type]/[Entity ID]

    This will work for notes, tickets, tools, tasks, projects, assets, people, and all other entities.

Please sign in to leave a comment.