Skip to main content
Question

Creating a group in TalentLMS using the beta API with Zapier


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

Did this topic help you find an answer to your question?

12 replies

Troy Tessalone
Forum|alt.badge.img+14

Hi ​@BillLodestarTech 

For us to have full and true context, post these screenshots:

  • how your Zap step is configured in EDIT mode with the field mappings visible
  • the encountered error

Hi-

 

Screenshots attached.

 

Thanks,

Bill

 


Troy Tessalone
Forum|alt.badge.img+14

@BillLodestarTech 

Generally for a POST API request…

  1. Additional Headers need to be set.
    1. e.g. Content-Type: application/json
    2. Default to the app API docs for requirements
  2. Body likely expects the JSON structure with the data to send
    1. Default to the app API docs for requirements

 

 


Mistryer
Forum|alt.badge.img
  • New
  • 17 replies
  • January 29, 2025

Hi ​@BillLodestarTech - ​@Troy Tessalone has got you on the right track here. 

There’s also a wealth of pre-configured API calls in this Postman Library that you can grab configuration from. https://www.postman.com/orange-meadow-4128/talentlms/request/reuk2ak/creategroup?tab=overview

 

 


Hi ​@Troy Tessalone and ​@Mistryer -

 

Thanks for trying to help with what should be a pretty straightforward problem. I’m still stuck, because their help desk said:

“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.”

Based on the Postman example, it seems like I should be able to use just https://{{domain}}/api/v1/creategroup as the URL, and then in body, I need to set the group name. 

 

  1. Do I still need to send an additional header? Should it be Content-Type → multipart/form-data
  2. What is the syntax needed for the body? For example: {“name”:”my_zapier_group”}, or something else?

I’ve tried a few combinations and am still seeing errors.

 

I’m not sure if I need to be setting that header, and I can’t seem to get the right syntax for the body field.

 

Thanks,

Bill


Troy Tessalone
Forum|alt.badge.img+14

@BillLodestarTech 

Post the encountered error from testing the Zap step to give us context.


@Troy Tessalone - the error is the exact same as I got the first time, 

 

Response Data Error Type

invalid_request_error

Response Data Error Message

Invalid arguments provided

 

Which leads me to believe it is a syntax error in the formatting of the group name field.


Troy Tessalone
Forum|alt.badge.img+14

@BillLodestarTech 

Posting a screenshot of the encountered error in the context of the Zap step helps us see reality.

You can also try asking ChatGPT for help troubleshooting the Zap step configuration.


@Troy Tessalone - Understood. Here’s the request and the 2 parts of the response.


Mistryer
Forum|alt.badge.img
  • New
  • 17 replies
  • January 30, 2025

Hmmmm, ​@BillLodestarTech - try these and let me know if it (and what) works: 

  1. clear out the headers and body. 
  2. under query string parameters:
    1. Left box, row 1: name
    2. Right box, row 1: My_zapier_group
    3. Left box, row 2: description
    4. Right box, row 2: test description group zapier
  3. Send the test.
  4. If it fails, remove the last “/” from the url
  5. If it still fails, add information to the “additional request headers” and test again
    • content-type (in left box)
    • form-data (in right box)
  6. If that fails, change form-data to form, then test again
  7. If that fails, change form  to multipart/form-data
  8. If that fails, re-run steps 6 & 7 with the “/” restored.

If all that fails… let’s keep working on it! 

Also, more documentation that may help: https://help.zapier.com/hc/en-us/articles/12899607716493-Set-up-an-API-Request-action#h_01JD2EGAHRRMRVNCZVXMEVFEG5


Hi ​@Mistryer - Well, we went 0 for 8, meaning none of that worked. However, I have since heard from TalentLMS, and it sounds like they might have an issue with the Beta API call, as they suggested I use a regular webhook in the meantime while they work on it. I was able to get the create group working with their API using a php script and curl, so that’s my workaround until they get their API fixed. I really appreciate you trying to help me anyway.

Thanks,

Bill


Troy Tessalone
Forum|alt.badge.img+14

@BillLodestarTech 

Try changing the Content-Type to: application/json