API Reference¶
Client object¶
The PathgatherClient is used to connect to the API and it offers
-
class
pathgather.
PathgatherClient
(host, api_key, proxy=None, skip_ssl_validation=False)[source]¶ The main API client
-
content
¶ Learning Content
Return type: pathgather.content.ContentClient
-
gatherings
¶ Learner Gatherings
Return type: pathgather.gatherings.GatheringsClient
-
paths
¶ Learning Paths
Return type: pathgather.paths.PathsClient
-
providers
¶ Pathgather Providers
Return type: pathgather.providers.ProvidersClient
-
skills
¶ Pathgather Skills
Return type: pathgather.skills.SkillsClient
-
users
¶ Users
Return type: pathgather.users.UserClient
-
Types¶
Accessors¶
pathgather.content module¶
-
class
pathgather.content.
ContentClient
(client)[source]¶ Bases:
object
Content API.
-
all
(from_page=None, query=None, filter=None)[source]¶ Get all content.
Parameters: - from_page (
str
) – Get from page - query (
dict
) – Additional filter query (see https://docs.pathgather.com/docs/filtering) - filter (
str
) – Additional type filter, e.g. “shared”, “official”, “pathgather”
Returns: A list of content
Return type: - from_page (
-
create
(name, content_type, source_url, topic_name, provider_name=None, provider_id=None, level=None, custom_id=None, description=None, image=None, tags=None, enabled=True, skills=None, duration=None)[source]¶ Create a piece of content in the catalogue.
Parameters: - name (
str
) – Name/title of the content - content_type (
pathgather.types.ContentType
orstr
) – The type of content being referenced Valid values are “Course”, “Document”, “Media”, “Webinar”, and “Webpage” - source_url (
str
) – The URL where this content can be found - topic_name (
str
) – Specify the name of the topic via the topic_name field, or if you are using a custom_id, then please set the topic_custom_id field. Topic must already exist. - provider_name (
str
) – Specify the name of the provider via the provider_name field, or if you are using a custom_id, then please set the provider_id field. Provider must already exist - provider_id (
str
) – Specify the ID of the provider - level (
pathgather.types.SkillLevel
orstr
) – The difficulty/experience level of the content Valid values are “Beginner”, “Intermediate”, “Advanced”, “Expert”, and “All” - custom_id (
str
) – Optional, but highly recommended if creating content via the API - description (
str
) – A description of the content to display to users when viewing it. Optional, but highly recommended - image (
str
) – The URL to an image to display to users when viewing the content - tags (
list
ofstr
) – An array of tags to associate to the content. Tags are primarily used for easy lookup later. - enabled (
bool
) – A flag representing whether this content is discoverable in your Pathgather content catalog. If false, it will not show up in normal content searches. - skills (
list
ofstr
) – An array of skills to associate to the content. Skills differ from tags, as they are displayed to the user and communicate the specific skill(s) the content will address.
- :param duration:Set to a value that represents the amount of time
- needed to complete the content. A wide variety of inputs are accepted (‘3 mins 4 sec’, ‘2 hrs 20 min’, etc). An error will be returned if the format is unknown. Integer values are also accepted and are assumed to be in seconds.
Returns: A piece of content Return type: pathgather.models.content.Content
- name (
-
create_comment
(id, message, user_id, custom_id=None)[source]¶ Create a comment on a content item
Parameters: - id (
str
) – The content item ID - message (
str
) – The comment text, in plain or HTML - user_id (
str
) – The ID of the user to create the comment as - custom_id (
str
) – Custom identifier for the comment
Returns: A content item comment
Return type: - id (
-
delete_comment
(id, comment_id)[source]¶ Delete a comment on a content item
Parameters: - id (
str
) – The content item ID - comment_id (
str
) – The comment ID
- id (
-
get
(id)[source]¶ Fetch a piece of content by ID.
Parameters: id ( str
) – Returns an individual content item. The ID provided can be the ID assigned upon content creation, or a custom ID you assigned to the content.Returns: A piece of content Return type: pathgather.models.content.Content
-
get_comments
(id, from_page=None, query=None)[source]¶ Get comments on a content item
Parameters: - id (
str
) – The content item ID - from_page (
str
) – Get from page - query – Extra query parameters
- query –
dict
Returns: A list of content item comments
Return type: - id (
-
log_completion
(content_id, completed_at='now', user_id=None, user_email=None)[source]¶ Logs that a user completed content. Use this API to automatically update a user’s Pathgather profile with learning activity that occurs in a different system.
Parameters: - content_id (
str
) – Can be the ID assigned upon creation, or a custom ID - completed_at (
str
) – The time the content was completed by the user. Must be a parseable timestamp or the word ‘now’ - user_id (
str
) – Required unless you specify user_email. Can be the ID assigned upon creation, or a custom ID - user_email (
str
) – Required unless you specify user_id. The email of the user that completed the content
Returns: A registration of user content completion
Return type: - content_id (
-
starts_and_completions
(from_page=None, query=None)[source]¶ Returns objects representing a user’s interaction (starts and completions) with content. User content items are returned sorted by start date, with the most recently started content appearing first.
Parameters: from_page ( str
) – Get from pageReturns: A list of content starts and completions Return type: list
ofpathgather.models.content.UserContent
-
update
(id, name=None, content_type=None, source_url=None, topic_name=None, provider_name=None, provider_id=None, level=None, custom_id=None, description=None, image=None, tags=None, enabled=True, skills=None, duration=None)[source]¶ Update a piece of content.
Parameters: - id (
str
) – The content id - name (
str
) – Name/title of the content - content_type (
pathgather.types.ContentType
orstr
) – The type of content being referenced Valid values are “Course”, “Document”, “Media”, “Webinar”, and “Webpage” - source_url (
str
) – The URL where this content can be found - topic_name (
str
) – Specify the name of the topic via the topic_name field, or if you are using a custom_id, then please set the topic_custom_id field. Topic must already exist. - provider_name (
str
) – Specify the name of the provider via the provider_name field, or if you are using a custom_id, then please set the provider_id field. Provider must already exist - provider_id (
str
) – Specify the ID of the provider - level (
pathgather.types.SkillLevel
orstr
) – The difficulty/experience level of the content Valid values are “Beginner”, “Intermediate”, “Advanced”, “Expert”, and “All” - custom_id (
str
) – Optional, but highly recommended if creating content via the API - description (
str
) – A description of the content to display to users when viewing it. Optional, but highly recommended - image (
str
) – The URL to an image to display to users when viewing the content - tags (
list
ofstr
) – An array of tags to associate to the content. Tags are primarily used for easy lookup later. - enabled (
bool
) – A flag representing whether this content is discoverable in your Pathgather content catalog. If false, it will not show up in normal content searches. - skills (
list
ofstr
) – An array of skills to associate to the content. Skills differ from tags, as they are displayed to the user and communicate the specific skill(s) the content will address.
- :param duration:Set to a value that represents the amount of time
- needed to complete the content. A wide variety of inputs are accepted (‘3 mins 4 sec’, ‘2 hrs 20 min’, etc). An error will be returned if the format is unknown. Integer values are also accepted and are assumed to be in seconds.
Returns: A piece of content Return type: pathgather.models.content.Content
- id (
-
pathgather.paths module¶
-
class
pathgather.paths.
PathsClient
(client)[source]¶ Bases:
object
Path API.
-
all
(from_page=None, query=None)[source]¶ Get all paths.
Paths are returned sorted by creation date, with the most recently created path appearing first.
Parameters: - from_page (
int
) – Get from page (when paginated) - query – Extra query parameters
- query –
dict
Returns: A list of paths
Return type: list
ofpathgather.models.path.Path
- from_page (
-
create_comment
(id, message, user_id, custom_id=None)[source]¶ Create a comment on a path
Parameters: - id (
str
) – The path ID - message (
str
) – The comment text, in plain or HTML - user_id (
str
) – The ID of the user to create the comment as - custom_id (
str
) – Custom identifier for the comment
Returns: A path comment
Return type: - id (
-
delete_comment
(id, comment_id)[source]¶ Delete a comment on a path
Parameters: - id (
str
) – The path ID - comment_id (
str
) – The comment ID
- id (
-
get
(id)[source]¶ Fetch a path by ID
Parameters: id ( str
) – Path IDReturns: A path Return type: pathgather.models.path.Path
-
get_comments
(id, from_page=None, query=None)[source]¶ Get comments on a path
Parameters: - id (
str
) – The path ID - from_page (
str
) – Get from page - query – Extra query parameters
- query –
dict
Returns: A list of path comments
Return type: - id (
-
starts_and_completions
(from_page=None, query=None)[source]¶ Returns objects representing a user’s interaction (starts and completions) with paths. User path items are returned sorted by start date, with the most recently started paths appearing first.
Parameters: - from_page (
str
) – Get from page - query – Extra query parameters
- query –
dict
Returns: A list of path starts and completions
Return type: list
ofpathgather.models.content.UserPath
- from_page (
-
pathgather.users module¶
-
class
pathgather.users.
UsersClient
(client)[source]¶ Bases:
object
Users API.
-
add_skill
(id, skill, level='All')[source]¶ Add a skill to a user
Parameters: - id (
str
) – The user ID - skill (
pathgather.models.skill.Skill
) – The skill to add - level (
str
or :enum:`pathgather.types.SkillLevel`) – The skill level
Returns: Instance of
pathgather.models.skill.UserSkill
Return type: - id (
-
add_skill_by_id
(id, skill_id, level='All')[source]¶ Add a skill to a user
Parameters: - id (
str
) – The user ID - skill_id (
str
) – The skill to add - level (
str
or :enum:`pathgather.types.SkillLevel`) – The skill level
Returns: Instance of
pathgather.models.skill.UserSkill
Return type: - id (
-
add_skill_by_name
(id, skill_name, level='All')[source]¶ Add a skill to a user
Parameters: - id (
str
) – The user ID - skill_name (
str
) – The skill to add - level (
str
or :enum:`pathgather.types.SkillLevel`) – The skill level
Returns: Instance of
pathgather.models.skill.UserSkill
Return type: - id (
-
all
(from_page=None, query=None)[source]¶ Get all users (will page results out)
Parameters: - from_page (
int
) – Start at page - query – Extra query parameters
- query –
dict
Returns: A list of users
Return type: list
ofpathgather.models.user.User
- from_page (
-
create
(name, job_title, department, email, saml_id=None, custom_id=None, hire_date=None, location='', avatar='', admin=False, send_invite=True, deactivated=False, custom_fields=None)[source]¶ Create a user.
Parameters: - name (
str
) – The users’ name - job_title (
str
) – The users’ job title - department (
str
) – If the department specified here matches the same name as an existing department, the user will be added to the existing department. If the department is not found, it will be created and the user added to it. - email (
str
) – The users’ email address - saml_id (
str
) – Required ONLY if your organization has SAML SSO enabled - custom_id (
str
) – Optional, but highly recommended - hire_date (
str
ordatetime.date
) – The hire date for the user - location (
str
) – Location of the user, e.g. Paris, France - avatar (
str
) – The URL to an image of the user - admin (
bool
) – Is user an admin? - send_invite (
bool
) – Send invite after creation via email? - deactivated (
bool
) – Is user deactivated? - custom_fields (
dict
) – Any custom fields for this user
Returns: An instance
pathgather.models.user.User
Return type: - name (
-
delete_skill
(id, user_skill)[source]¶ Delete the skill for a user
Parameters: - id (
str
) – The user ID - user_skill (
pathgather.models.skill.UserSkill
orstr
) – The user skill to delete
- id (
-
get
(id)[source]¶ Fetch a user by ID.
Parameters: id ( str
) – The user idReturns: An instance pathgather.models.user.User
Return type: pathgather.models.user.User
-
get_by_email
(email)[source]¶ Get a user by email
Parameters: email ( str
) – User’s email addressReturns: A users Return type: pathgather.models.user.User
-
skills
(id)[source]¶ Get user skills
Parameters: id ( str
) – The user IDReturns: the skills for this user Return type: list
pathgather.models.skill.UserSkill
-
update
(id, name=None, job_title=None, department=None, email=None, saml_id=None, custom_id=None, hire_date=None, location=None, avatar=None, admin=None, deactivated=None, custom_fields=None)[source]¶ Update a user.
Parameters: - id (
str
) – The user id - name (
str
) – The users’ name - job_title (
str
) – The users’ job title - department (
str
) – If the department specified here matches the same name as an existing department, the user will be added to the existing department. If the department is not found, it will be created and the user added to it. - email (
str
) – The users’ email address - saml_id (
str
) – Required ONLY if your organization has SAML SSO enabled - custom_id (
str
) – Optional, but highly recommended - hire_date (
str
ordatetime.date
) – The hire date for the user - location (
str
) – Location of the user, e.g. Paris, France - avatar (
str
) – The URL to an image of the user - admin (
bool
) – Is user an admin? - deactivated (
bool
) – Is user deactivated? - custom_fields (
dict
) – Any custom fields for this user
Returns: An instance
pathgather.models.user.User
Return type: - id (
-
update_skill_level
(id, skill, level)[source]¶ Update the skill level for a user
Parameters: - id (
str
) – The user ID - skill (
pathgather.models.skill.Skill
) – The skill to add - level (
str
or :enum:`pathgather.types.SkillLevel`) – The skill level
Returns: Instance of
pathgather.models.skill.UserSkill
Return type: - id (
-
pathgather.gatherings module¶
-
class
pathgather.gatherings.
GatheringsClient
(client)[source]¶ Bases:
object
Gatherings API.
-
add_content
(id, content_id)[source]¶ Add a piece of content to a gathering
Parameters: - id (
str
) – The gathering id - content_id (
str
) – The content id
Returns: A dict
Return type: dict
- id (
-
all
(from_page=None)[source]¶ Get all gatherings (will page results out)
Parameters: from_page ( int
) – Start at pageReturns: A list of users Return type: list
ofpathgather.models.gathering.Gathering
-
content
(id, from_page=None)[source]¶ Fetch a gathering’s content by ID.
Parameters: id ( str
) – The gathering idReturns: An list of pathgather.models.gathering.GatheringUser
Return type: list
ofpathgather.models.gathering.GatheringUser
-
create
(name, custom_id=None, description=None, closed=True, image=None, skills=None)[source]¶ Create a gathering.
Parameters: - name (
str
) – Name/title of the gathering - custom_id (
str
) – Optional, but highly recommended if creating content via the API - description (
str
) – A description of the content to display to users when viewing it. Optional, but highly recommended - image (
str
) – The URL to an image to display to users when viewing the content - closed (
bool
) – A flag representing whether this gathering is discoverable in your Pathgather catalog. If false, it will not show up in normal searches. - skills (
list
ofstr
) – An array of skills to associate to the content. Skills differ from tags, as they are displayed to the user and communicate the specific skill(s) the content will address.
Returns: A gathering
Return type: pathgather.models.gathering.Gathering
- name (
-
get
(id)[source]¶ Fetch a gathering by ID.
Parameters: id ( str
) – The gathering idReturns: An instance pathgather.models.gathering.Gathering
Return type: pathgather.models.gathering.Gathering
-
invite_user
(id, user_id)[source]¶ Invite a user to a gathering
Parameters: - id (
str
) – The gathering id - user_id (
str
) – The user id
Returns: An instance
pathgather.models.gathering.UserGathering
Return type: pathgather.models.gathering.UserGathering
- id (
-
paths
(id, from_page=None)[source]¶ Fetch a gathering’s paths by ID.
Parameters: id ( str
) – The gathering idReturns: An list of pathgather.models.gathering.GatheringPath
Return type: list
ofpathgather.models.gathering.GatheringPath
-
remove_content
(id, content_id)[source]¶ Remove content from a gathering
Parameters: - id (
str
) – The gathering id - content_id (
str
) – The content id
- id (
-
remove_path
(id, path_id)[source]¶ Remove path from a gathering
Parameters: - id (
str
) – The gathering id - path_id (
str
) – The path id
- id (
-
remove_user
(id, user_id)[source]¶ Remove a user from a gathering
Parameters: - id (
str
) – The gathering id - user_id (
str
) – The user id
- id (
-
update
(id, name, custom_id=None, description=None, closed=True, image=None, skills=None)[source]¶ Update a gathering.
Parameters: - id (
str
) – The gathering ID - name (
str
) – Name/title of the gathering - custom_id (
str
) – Optional, but highly recommended if creating content via the API - description (
str
) – A description of the content to display to users when viewing it. Optional, but highly recommended - image (
str
) – The URL to an image to display to users when viewing the content - closed (
bool
) – A flag representing whether this gathering is discoverable in your Pathgather catalog. If false, it will not show up in normal searches. - skills (
list
ofstr
) – An array of skills to associate to the content. Skills differ from tags, as they are displayed to the user and communicate the specific skill(s) the content will address.
Returns: A gathering
Return type: pathgather.models.gathering.Gathering
- id (
-
pathgather.skills module¶
-
class
pathgather.skills.
SkillsClient
(client)[source]¶ Bases:
object
Skills API.
-
all
(from_page=None)[source]¶ Get all skills (will page results out)
Parameters: from_page ( int
) – Start at pageReturns: A list of users Return type: list
ofpathgather.models.skill.Skill
-
create
(name, custom_id=None)[source]¶ Create a skill.
Parameters: - name (
str
) – The skill name - custom_id (
str
) – Optional, but highly recommended
Returns: An instance
pathgather.models.skill.Skill
Return type: - name (
-
get
(id)[source]¶ Fetch a skill by ID.
Parameters: id ( str
) – The user idReturns: An instance pathgather.models.skill.Skill
Return type: pathgather.models.skill.Skill
-
update
(id, name=None, custom_id=None)[source]¶ Update a skill.
Parameters: - id (
str
) – The skill id - name (
str
) – The skill name - custom_id (
str
) – Optional, but highly recommended
Returns: An instance
pathgather.models.skill.Skill
Return type: - id (
-
Models¶
pathgather.models.content module¶
-
class
pathgather.models.content.
Content
(id, name, content_type, source_url, enabled, created_at=None, description='', instructor=None, skills=None, tags=None, rating=0, reviews_count=0, level=None, duration=None, updated_at=None, provider=None, topic=None, custom_id=None, start_date=None, end_date=None, deactivated=False, sharer_id=None, publicly_accessible=True, endorsement_count=0, sharer=None)[source]¶ Bases:
object
-
class
pathgather.models.content.
ContentComment
(id, created_at=None, updated_at=None, message=None, content=None, conversation=None, path=None, custom_id=None, user=None)[source]¶ Bases:
object
pathgather.models.department module¶
pathgather.models.path module¶
-
class
pathgather.models.path.
Path
(id, name, created_at, published, description=None, url=None, user_id=None, slug=None, user_started_count=0, user_completed_count=0, privately_completed_count=0, privately_started_count=0, courses_count=0, comments_count=0, created_at_unix=None, topic_id=None, image=None, endorsed=False, promoted=None, added_by_admin=False, path_sections_count=0, endorsed_count=0, publicly_accessible=None, updated_at=None, saved_at=None, published_at=None, custom_id=None, tags=None, skills=None, user=None, gatherings=None, endorsement_count=0)[source]¶ Bases:
object
pathgather.models.skill module¶
pathgather.models.user module¶
-
class
pathgather.models.user.
User
(id, first_name, last_name, created_at, email, job_title, deactivated, admin=None, name=None, description='', avatar=None, url=None, job_function=None, username=None, slug=None, updated_at=None, active_at=None, active_at_unix=None, secure_images=None, linkedin_url=None, public_courses_started_count=0, public_courses_completed_count=0, public_paths_started_count=0, public_paths_completed_count=0, user_interests=0, learning_history_public_default=0, language=None, skills=None, company_admin=False, company_admin_scope=None, saml_id=None, requires_password_auth=None, followers_count=0, following_count=0, score=0, hire_date=None, location=None, last_active_at=None, department=None, user_skills=None, custom_id=None, custom_fields=None)[source]¶ Bases:
object