Bulk Program Member Import | Community
Skip to main content
New Participant
July 13, 2023
Solved

Bulk Program Member Import

  • July 13, 2023
  • 3 replies
  • 2233 views

Not really sure what I am doing wrong but my Bulk Member Import is failing. This is a bulk import on a Webinar with the following status options (Invited, Waitlisted, Registered, No Show, Attended, Attended On-Demand)

 

Here is my code

 

endpoint = '/bulk/v1/program/'+str(program_id)+'/members/import.json'
args = {
'access_token': access_token,
'format': 'csv',
'programId': str(program_id),
'programMemberStatus': 'Invited'
}
with open('C:\Python27\Code\Python\Test Scripts\eventlist.csv', 'rb') as oFile:
files = {'file': ('eventlist.csv', oFile, 'text/path')}
resp = requests.post(host1 + endpoint, params=args, files=files)
print(resp.headers)
print(resp.json())

 

Here is the error message - 

 

{'Date': 'Thu, 13 Jul 2023 17:46:20 GMT', 'Server': 'nginx', 'Connection': 'Keep-Alive', 'Content-Type': 'application/json;charset=UTF-8', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked'}
{'requestId': 'd20b#184556c6864, 'success': False, 'errors': [{'code': '1006', 'message': "Header field 'Program Status' not found"}]}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Darshil_Shah1

“Program Status” isn’t the correct/allowable field name in the header (first row) of your import file. The first row of the file must be a header which lists the corresponding REST API names as fields to map the values of each row into.  REST API names can be retrieved using Describe Lead and/or Describe Program Member endpoints.  FYR, records can contain lead fields, custom lead fields, and custom program member fields. You should check the API name of the “Program Status” field from the above applicable endpoint based on whether the field is a lead or a program member field.

3 replies

Darshil_Shah1
Community Manager
July 14, 2023

Indeed- it'd be great if you could provide the complete details about the API config. I gave my input based on the API response you have shared, but it wouldn't hurt to take a look at the complete API details including the payload.

 

New Participant
July 21, 2023

your initial response was supe helpful. thank you for your reply.

If there is a will, there is a way.
SanfordWhiteman
New Participant
July 13, 2023

Can you please highlight your code (using "Insert/Edit Code Sample") and include the actual payload generated by your code?

Remember, the API doesn't speak Python. It speaks JSON, multipart/mime, or application/x-www-form-urlencoded.

Darshil_Shah1
Darshil_Shah1Accepted solution
Community Manager
July 13, 2023

“Program Status” isn’t the correct/allowable field name in the header (first row) of your import file. The first row of the file must be a header which lists the corresponding REST API names as fields to map the values of each row into.  REST API names can be retrieved using Describe Lead and/or Describe Program Member endpoints.  FYR, records can contain lead fields, custom lead fields, and custom program member fields. You should check the API name of the “Program Status” field from the above applicable endpoint based on whether the field is a lead or a program member field.