Skip to main content
February 20, 2007
Question

How to find sco-id for principal?

  • February 20, 2007
  • 3 replies
  • 2216 views
I need to create a webpage that deletes a user and the meeting folder and content associated to that user. If I have the principal-id of the user to be deleted, how do I find the sco-id for the user's meeting folder? So far, I haven't found an api call that seems to offer that connection.

- Thanks
    This topic has been closed for replies.

    3 replies

    February 20, 2007
    Thanks! I missed that important piece.
    February 20, 2007
    Thank you for responding. I had seen sco-shortcuts, but the problem is the sco-shortcuts call uses the principal-id for the user currently logged in. In our case, the person to be deleted will not be logged in - an admin person will be. The call would be perfect if it accepted a principal-id parameter.

    Any other ideas?
    February 20, 2007
    It also returns the "user-meetings" folder, which you can then run sco-contents on its sco and filter by the username, and then you have that person's user-meeting folder.
    February 20, 2007
    Page 42 of the XML API. It'll take a little bit of work, but as far as I can tell, it's the best way to find the sco.

    Find a SCO when you do not know the sco-id
    1. Call sco-shortcuts to get a list of root folders on Connect Enterprise:
    https://example.com/api/xml?action=sco-shortcuts
    2. Parse the response for a type of the root folder that would logically contain the SCO, for
    example, my-courses for a course the user has created.
    3. Parse the resulting sco element for a sco-id:
    <sco tree-id="4930295" sco-id="2006258748" type="my-courses">
    <domain-name> http://example.com</domain-name>
    </sco>
    4. Create a call to sco-expanded-contents to list the contents of the folder, adding an exact
    match filter, if possible:
    https://example.com/api/xml?action=sco-expanded-contents
    &sco-id=2006258748&filter-name=All About Web Communities
    You have several choices of filters:
    ■ An exact match filter on name or url-path (like filter-name or filter-url-path),
    if you know the name or URL of the SCO
    ■ A greater-than or less-than date filter (filter-gt-date or filter-lt-date) on
    date-begin, date-created, or date-modified, if you know one of those dates
    ■ A partial name filter (like filter-like-name), if you do not know the exact SCO
    name. However, using this filter might affect system performance.
    5. Parse the response for the sco-id:
    <sco depth="1" sco-id="2006745671" folder-id="2006258748" type="folder"
    icon="folder" lang="en" source-sco-id="2006745669" display-seq="0"
    Find SCOs 43
    source-sco-type="14">
    <name>A Day in the Life Resources</name>
    <url-path>/f28435879/</url-path>
    <date-created>2006-06-12T14:47:59.903-07:00</date-created>
    <date-modified>2006-06-12T14:47:59.903-07:00</date-modified>
    </sco>