Hi-
I’m using Zapier to create new records in TalentLMS. Zapier has a “create user” action, which is simple enough. However, there is no “create group” action. TalentLMS does provide a “Beta API” option, which allows access to their full API list. I’ve used the Beta API to successfully retrieve information (e.g., list of users in a course). However, I’m having trouble figuring out the syntax to use it to create a group. I have their documentation, which is here: https://market.talentlms.com/pages/docs/TalentLMS-API-Documentation.pdf . I found the endpoint, which should be something like: https://<my subdomain>.talentlms.com/api/v1/creategroup . I’m assuming I have to use a POST or PUT method. What I’m struggling with is the syntax in zapier to pass in the expected array values. And of course, I will want to be able to use variables from earlier in the zap to populate the array values. Does it go in the URL query string, like a GET request? Or does it go in the query string parameter fields? I’ve tried both unsuccessfully.
I had posted about this previously
and had received a response, but unfortunately it did not work, and that thread is now closed, so I’m creating a new one. In particular, the tech support told me:
“JSON is not fully supported for all requests in the TalentLMS API I am afraid. Multipart/formdata is the content type we have set up the API to work with.”
Thus, the suggestion to use a generic Webhooks by Zapier with JSON payload will not work.
Furthermore the TalentLMS beta API already handles the credentials, etc., so if I used that instead of a generic WebHook, I only need to get the syntax of the URL and post fields correct, and don’t have to worry about authentication.
I’m trying to create a group with the minimum single field of name that is required. My failed Post url looks like:
https://<mysubdomain>.talentlms.com/api/v1/creategroup/name:my_zapier_group
Which returns:
{"error":{"type":"invalid_request_error","message":"Invalid arguments provided"}}
Similar syntax works fine for GET operations.
In the TalentLMS beta api call, there are fields for the URL, query string parameters, additional request headers, and body. I’m struggling with the proper syntax for the “name = my_zapier_group,” in terms of which field to use in Zapier, and how to format it. The API documentation says this:
You can create a new group by calling TalentLMS_Group::create(array('name' =>
'{name}', 'description' => '{description}', 'key' => '{key}', 'price' => '{price}', 'creator_id'
=> '{creatorId}', 'max_redemptions' => '{maxRedemptions}')). The fields ‘description’,
‘key’, ‘price’ and ‘max_redemptions’ are optional. The field ‘creator_id’ denotes the
id of the user that will be the owner of the group. If omitted then the owner – creator
is the owner of the account (super-administrator). If the provided arguments are
valid, then the above call returns a response in the following format.
I’m curious if anyone has successfully create a new group in TalentLMS using Zapier, and can discern from the info above how I might go about doing it?
Thanks,
Bill