Unable to pass in options with Ruby

Hi all,

I’m taking my first steps in the API and trying a couple of things with Ruby which I haven’t used in the last 3+ years so I’m a bit rusty. I’m creating a script that cycles through projects and removes unwanted custom fields. I’m having trouble figuring out how to pass in the custom field that I want to remove as an option.

project_gid=“1202574217132851”

client = Asana::Client.new do |c|
c.authentication :access_token, token
end

client.projects.remove_custom_field_setting_for_project(project_gid: project_gid, options: {custom_field: [‘1193404856761801’] })

And the error I get is:

`rescue in handle’: custom_field: Missing input (Asana::Errors::InvalidRequest)
the server responded with status 400 (Faraday::BadRequestError)

I understand this is telling me my query is written correctly and I’ve looked at Asana but I can’t figure out how to add the data body.

Any tips? Also I’d love it if you could share any resources with Ruby examples.

Thanks

Hi,

I am looking at the API doc and can’t seem to find the endpoint this method would be using. Can you point me to it please?

Hi Bastien,

Do you mean this doc Asana?

Thanks

Thanks, I was unable to find it somehow.

Did you read the source code of the lib? My guess is that the second param should be something else, or named differently. Maybe you can also log what is the call made by the library.