Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8709715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:26:04+00:00 2026-06-13T04:26:04+00:00

I am creating a program that will automate some functions with Asana for my

  • 0

I am creating a program that will automate some functions with Asana for my workplace but am a bit stuck. I am able to submit multiple tasks to a workspace and retrieve the task ID’s of each but was wondering how to take only the ID portion of the response and store it into an array or list in C#.

The response from the GET on /tasks?workspace=<workspace-id>&assignee=me is:

{"data":[{"id":2177890732156,"name":"<name of my task>"}]}

I want to store the id number(s) from all my tasks into an array so I can perform an addProject PUT to each of them.

I am using a serializer to put data elements into the proper dictionary for POSTing but am wondering if there is a way to reverse it and parse only the int portion of the response, store it in an array and call it back up.

The serializer code is as follows:

public static string GetJsonByObject(object _object)
    {
        /// Serialize to JSON
        DataContractJsonSerializer serializer = new DataContractJsonSerializer(_object.GetType());
        MemoryStream ms = new MemoryStream();
        serializer.WriteObject(ms, _object);
        return Encoding.Default.GetString(ms.ToArray());
    }

and I have been storing my requests in a byte array as follows:

string content;

content = GetJsonByObject(t);
bArrContent = Encoding.UTF8.GetBytes(content);
            request.GetRequestStream().Write(bArrContent, 0, bArrContent.Length);
            request.GetRequestStream().Close();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:26:05+00:00Added an answer on June 13, 2026 at 4:26 am

    It is certainly possible to use some Regex-fu to parse out the ID fields and store them. However, that’s kindof nasty – Structured data formats like JSON and XML exist for the purpose of having someone else’s parsing library do the dirty work for you.

    So, suggestion 1: Use JSON.Net instead of DataContractSerializer. It sucks less.

    which leads to suggestion 2: Use a library to deserialize your data cleanly, then use Linq to grab the ID elements:

    JObject jobj = JObject.Parse(serializedData);
    UInt64[] idArr = ((JArray)jobj["data"]).Select(jItem => UInt64.Parse((string)((JObject)jItem["id"]))).ToArray();
    

    Now you should have the list of IDs as an array in idArr.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a program that will multiple background tasks simultaneously. I would like
I am in the process of creating a program that will automate the packaging,
I am creating a program that allows you to paste text but it will
I am creating a program that will run an experiment on a user. It
I am creating a program that will fill in a given grammar. Right now
OK, let's say I am creating a program that will list users contacts in
I'm creating a Win32 program that will be executed every time the computer turns
I am creating a program that I will use to help my customers recover
im creating a program that will compile java files, at the moment i have
I'm planning on creating a program that will have a login form and then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.