run-time error 449 Argument Not Optional (1 Viewer)

yuenling1995

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 22, 2020
Messages
20
Jess
MajP sent me a PM asking me to look at this thread.
To save me time needing to read through the whole thread in detail, can you please summarise what the issue is.
Is it your code or have you downloaded and adapted it from somewhere - if so where?
Also have you checked whether the JSON file you are trying to upload is valid?

Hi islandogs! Thank you so much for taking the time to help me with this!

This is my code, I'm using Qualtrics API to generate survey distribution links and send emails to participants over Qualtrics.

In other words, I'm using HTTP request to send information to the qualtrics server with certain info (surveyID, messageID, etc.), and Qualtrics will generate survey links and send emails to participants in the mailing list.

I'm trying to call the http request in json format and run into this error:
Code:
{"meta":{"httpStatus":"400 - Bad Request","error":{"errorMessage":"Expected param not found: sendDate","errorCode":"RP_10"},"requestId":"563d7dd0-4dca-4ed6-8e6b-084b4078ed02"}}

My JSON body is like the following when I run the function:
Code:
{"Message":[{"fromEmail":"day2day%40chestnyc.org","fromName":"day2day","subject":"day2day%20Afternoon%20Survey"},{"sendDate":"2020-01-24T12:00:00Z"},{"messageId":"MS_3f7Y9QJmoQmR6q9","recipients":"MLRP_9oTXqBsMs6bdbpz","surveyId":"SV_4SAKPbbRMWxdVR3","expirationDate":"2020-01-24T16:00:00Z"}]}


Please let me know if you have any questions, thank you so much!

Best,
Jess
 

isladogs

MVP / VIP
Local time
Today, 02:44
Joined
Jan 14, 2017
Messages
18,164
I'll try & look later.
Its a valid JSON file but I know nothing about Qualtrics or its API
Do you have a link?
If it needs an account, could you PM me with any API key info if relevant

You may have answered this elsewhere but ....
Is it the HTTP SEND line that triggers error 449?
Is SendDate the issue? If not, what?
Do Qualtrics want the date in a different format?
 

yuenling1995

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 22, 2020
Messages
20
I'll try & look later.
Its a valid JSON file but I know nothing about Qualtrics or its API
Do you have a link?
If it needs an account, could you PM me with any API key info if relevant

You may have answered this elsewhere but ....
Is it the HTTP SEND line that triggers error 449?
Is SendDate the issue? If not, what?
Do Qualtrics want the date in a different format?


Hey there, here is the Qualtrics API documentation reference link for the function "Create Survey Distribution Links & Send Emails":
https://api.qualtrics.com/reference#distribution-create-1

This is the URL to call the API: https://az1.qualtrics.com/API/v3/distributions

Nah it's not the send line that triggers the error, it's this line:
Code:
    dicMessage("header") = dicHeader

But when I declare a collection object to combine "dicHeader", "dicMessage", the 449 error is gone and this new error pops up:

Code:
{"meta":{"httpStatus":"400 - Bad Request","error":{"errorMessage":"Expected param not found: sendDate","errorCode":"RP_10"},"requestId":"563d7dd0-4dca-4ed6-8e6b-084b4078ed02"}}

Let me know if you need anything, thank you again for your help!!!

Best,
Jess
 

Solo712

Registered User.
Local time
Yesterday, 22:44
Joined
Oct 19, 2012
Messages
828
Hey there, here is the Qualtrics API documentation reference link for the function "Create Survey Distribution Links & Send Emails":
https://api.qualtrics.com/reference#distribution-create-1

This is the URL to call the API: https://az1.qualtrics.com/API/v3/distributions

Nah it's not the send line that triggers the error, it's this line:
Code:
    dicMessage("header") = dicHeader

But when I declare a collection object to combine "dicHeader", "dicMessage", the 449 error is gone and this new error pops up:

Code:
{"meta":{"httpStatus":"400 - Bad Request","error":{"errorMessage":"Expected param not found: sendDate","errorCode":"RP_10"},"requestId":"563d7dd0-4dca-4ed6-8e6b-084b4078ed02"}}

Let me know if you need anything, thank you again for your help!!!

Best,
Jess

Hi Jess,
I noticed that in the Qualtrics C&D Links structure there is no "header" item in the "message" member. The line causing the error
Code:
dicMessage("header") = dicHeader
looks strange because it is supposed to point to another dictionary structure, which is already defined.
Have you tried deleting, or commenting it out ?

Best,
Jiri
 

yuenling1995

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 22, 2020
Messages
20
Hi Jess,
I noticed that in the Qualtrics C&D Links structure there is no "header" item in the "message" member. The line causing the error
Code:
dicMessage("header") = dicHeader
looks strange because it is supposed to point to another dictionary structure, which is already defined.
Have you tried deleting, or commenting it out ?

Best,
Jiri

Dear Jiri,

Thank you for your reply! I tried to comment it out and still have the argument not optional error..

Best,
Jess
 

isladogs

MVP / VIP
Local time
Today, 02:44
Joined
Jan 14, 2017
Messages
18,164
Jess
I'm not sure what to look for at the Qualtrics API site but it would appear that an API key is required (as is standard).
Sorry but I have no intention of obtaining my own API in order to test this

It would be much easier to test if you can upload a stripped down copy of your app removing all objects not required and any confidential data.

Repeat question:
Have you checked whether the supplied date is in an acceptable format for Qualtrics?
 

yuenling1995

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 22, 2020
Messages
20
Jess
I'm not sure what to look for at the Qualtrics API site but it would appear that an API key is required (as is standard).
Sorry but I have no intention of obtaining my own API in order to test this

It would be much easier to test if you can upload a stripped down copy of your app removing all objects not required and any confidential data.

Repeat question:
Have you checked whether the supplied date is in an acceptable format for Qualtrics?

Dear islandogs,

Thank you so much for getting back to me! I'll PM you the API token, and I'm not sure what you mean by the copy of my app, but I can email you all the functions and sub involved without the confidential data.

Also I have checked the supplied date, it's the standard time that qualtrics accepts.

Best,
Jess
 

isladogs

MVP / VIP
Local time
Today, 02:44
Joined
Jan 14, 2017
Messages
18,164
Hi Jess
I'd prefer to have the Access app itself (after removing anything irrelevant or confidential ) so I can test using exactly what you are using, Thanks

One more thing before you do so.
Have you checked the required VBA references are all present & correct & that the project compiles?

P.S. No 'n' in my username
 

yuenling1995

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 22, 2020
Messages
20
Hi Jess
I'd prefer to have the Access app itself (after removing anything irrelevant or confidential ) so I can test using exactly what you are using, Thanks

One more thing before you do so.
Have you checked the required VBA references are all present & correct & that the project compiles?

P.S. No 'n' in my username

Dear isladogs,

Omg noo I'm so sorry for mistype your name this whole time!!
Sure thing I'll create a copy now, how can I send it to you tho?

Best,
Jess
 

isladogs

MVP / VIP
Local time
Today, 02:44
Joined
Jan 14, 2017
Messages
18,164
No problem - I've been called far worse. :rolleyes:
My email is a link in my signature line beside my actual name! ;)
Please compact, zip & give me all info I need to look at it.
Probably won't be until tomorrow now as its getting late here in the UK

Did you check references & that it compiled?
Also which version/bitness of Access are you using?
 

yuenling1995

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 22, 2020
Messages
20
No problem - I've been called far worse. :rolleyes:
My email is a link in my signature line beside my actual name! ;)
Please compact, zip & give me all info I need to look at it.
Probably won't be until tomorrow now as its getting late here in the UK

Did you check references & that it compiled?
Also which version/bitness of Access are you using?

Dear isladogs,

Sure thing! No rush at all I'm sorry to bother you this late!!
I did check the references list and everything seems fine and it compiles normally, and I'm using Access 2007-2010

Have a great night!

Best,
Jess
 

Solo712

Registered User.
Local time
Yesterday, 22:44
Joined
Oct 19, 2012
Messages
828
Dear Jiri,

Thank you for your reply! I tried to comment it out and still have the argument not optional error..

Best,
Jess

Just curious: on which line of code do you get the error after you comment out the line it caused the problem previously?

Best,
Jiri
 

yuenling1995

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 22, 2020
Messages
20
Hi Jess
I'd prefer to have the Access app itself (after removing anything irrelevant or confidential ) so I can test using exactly what you are using, Thanks

One more thing before you do so.
Have you checked the required VBA references are all present & correct & that the project compiles?

P.S. No 'n' in my username

Dear isladogs,

Sorry I didn't get to send you the Access file last Friday, was caught up with another task!! I will try my best to send it to you today, do you think you'll still have some time to debug it? Thank you so much I appreciate you! Happy Monday :))

Best,
Jess
 

isladogs

MVP / VIP
Local time
Today, 02:44
Joined
Jan 14, 2017
Messages
18,164
I'm certainly willing to try. I'm out all day tomorrow and have commitments every day this week but should be able to find some time.
Please pass on as much useful info as possible and spell out exactly how to trigger the error and where it happens..
Whether I can fix it, we'll have to wait and see.
 

yuenling1995

Registered User.
Local time
Yesterday, 19:44
Joined
Jan 22, 2020
Messages
20
I'm certainly willing to try. I'm out all day tomorrow and have commitments every day this week but should be able to find some time.
Please pass on as much useful info as possible and spell out exactly how to trigger the error and where it happens..
Whether I can fix it, we'll have to wait and see.

Dear isladogs,

Thank you for your kind reply! I'll try to explain it in as much detail as possible! I'm really thanksful for everything you've done and will do to help me on this issue!!

Best,
Jessica
 

Users who are viewing this thread

Top Bottom