# iphone sdk sending params instead of template\_id

**URL:** <https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822>\
**Category:** Transloadit\
**Tags:** tender-archive\
**Created:** [December 20, 2010, 4:09pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822 "2010-12-20T16:09:00Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![stanislas.duprey](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/stanislas.duprey/32/1478_2.png) [@stanislas.duprey](https://community.transloadit.com/u/stanislas.duprey)\
**Post date:** [December 20, 2010, 4:09pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/1 "2010-12-20T16:09:00Z")

</div>

> Archived from the Transloadit support forum. Originally posted on December 20, 2010; details may be outdated, see [our docs](https://transloadit.com/docs/) for current behavior. [Original thread](https://web.archive.org/web/20110222131835/http://support.transloadit.com/discussions/suggestions/19-iphone-sdk-sending-params-instead-of-template_id)

In the case of an upload via a web form, we have the choice between sending “params” as form data, or “template\_id” as form data.  
In the iphone SDK only “template\_id” is available.

This is a problem for my application where I cannot use a template because the notify url contains a user\_id that is specific to each upload, and thus cannot be part of a template (except if template accept variables, which I am not aware of?)

How can I send this via the SDK?

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [December 21, 2010, 9:51am UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/2 "2010-12-21T09:51:00Z")

</div>

I think I need to give the iPhone SDK a little love : ). I’ll be working on it today and update the ticket here.

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [December 21, 2010, 3:27pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/3 "2010-12-21T15:27:00Z")

</div>

Alright, I had a look and it turns out the sdk can already do what you need. I did however add new example to the documentation:

[https://github.com/transloadit/iphone-sdk/commit/REDACTED](https://github.com/transloadit/iphone-sdk/commit/REDACTED)

Also: You can specify a template\_id and params at the same time. The params will be recursively merged into your template.

Let me know if this helps!  
--fg

---

<div class="post-metadata">

**Author:** ![Trancendental](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/trancendental/32/1483_2.png) [@Trancendental](https://community.transloadit.com/u/Trancendental)\
**Post date:** [December 21, 2010, 5:05pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/4 "2010-12-21T17:05:00Z")

</div>

Hi, I looked at the example. Would you be able to provide a downloadable example that I can build? I tried out your tweak to add params but got build errors where I needed to define resizestep and step. I defined them higher up but it would help ease the mind if you had an example that passes params that can build.

Thanks.

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [December 21, 2010, 5:25pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/5 "2010-12-21T17:25:00Z")

</div>

Hi, I’m really sorry - I forgot to add the declaration for those two variables to the example:

[https://github.com/transloadit/iphone-sdk/commit/REDACTED](https://github.com/transloadit/iphone-sdk/commit/REDACTED)

Let me know if it works now!

---

<div class="post-metadata">

**Author:** ![Trancendental](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/trancendental/32/1483_2.png) [@Trancendental](https://community.transloadit.com/u/Trancendental)\
**Post date:** [December 21, 2010, 6:14pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/6 "2010-12-21T18:14:00Z")

</div>

Thanks so much for the help… I got the code to compile and I just tried uploading. What I got was the following error:

-JSONValue failed. Error trace is: ( “Error Domain=org.brautaset.JSON.ErrorDomain Code=3 “Unrecognised leading character” UserInfo=0x10c1c0 {NSLocalizedDescription=Unrecognised leading character}”

When I outputted what I was sending, I am sending the following:

{ resize = { robot = “/image/resize”; use = “:original”; width = 90; }; store = { bucket = “cutiesafari\_us\_test”; key = REDACTED; robot = “/s3/store”; secret = “7QO93k/IcNE+ip1VfEnU02/j9ENpZuFBLgMvzfFg”; }; }

I know that I need to add comas to separate out each value pair, but how about the extra semi-colons? How do I remove those?

Thanks again.

---

<div class="post-metadata">

**Author:** ![stanislas.duprey](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/stanislas.duprey/32/1478_2.png) [@stanislas.duprey](https://community.transloadit.com/u/stanislas.duprey)\
**Post date:** [December 21, 2010, 9:51pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/7 "2010-12-21T21:51:00Z")

</div>

Hi Felix,

This is working for one rule, when I put more rules, it keeps putting the store at the beginning of the assembly!

here is my code:

```auto
NSMutableDictionary *steps = [[NSMutableDictionary alloc] init];
NSMutableDictionary *resizeStep = [[NSMutableDictionary alloc] init];
NSMutableDictionary *store = [[NSMutableDictionary alloc] init];

[[transload params] setObject:strNotifyURL forKey:@"notify_url"];
[[transload params] setObject:steps forKey:@"steps"];

[steps setObject:resizeStep forKey:@"resize"];
[steps setObject:store forKey:@"store"];

[store setObject:strTransLoadItSecret forKey:@"secret"];
[store setObject:@"..." forKey:@"key"];
[store setObject:@"cutiesafari_us_test" forKey:@"bucket"];
[store setObject:@"/s3/store" forKey:@"robot"];
[store setObject:@"resize" forKey:@"use"];

[resizeStep setObject:[NSNumber numberWithInt:90] forKey:@"width"];
[resizeStep setObject:@"/image/resize" forKey:@"robot"];
[resizeStep setObject:@":original" forKey:@"use"];

```

And the result of the assembly:  
[https://transloadit.com/assemblies/view/REDACTED](https://transloadit.com/assemblies/view/REDACTED)  
You can see store is before resize, so it does not work.

Of course I tried to revert the setObject and do:

```auto
[steps setObject:store forKey:@"store"];
[steps setObject:resizeStep forKey:@"resize"];

```

But no luck…

Any idea?

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [December 21, 2010, 11:47pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/8 "2010-12-21T23:47:00Z")

</div>

That’s probably a problem with the JSON library we use, and it doesn’t sound like it’s going to be easy to fix. JSON itself says ordering on the keys isn’t guaranteed, so it’s compliant with the spec.

The solution is to set an explicit `"use": "step"` parameter, this way your assembly steps can be ordered without relying on the order send via JSON.

Let me know if that makes!

---

<div class="post-metadata">

**Author:** ![Brian\_Hammond](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/brian_hammond/32/1484_2.png) [@Brian\_Hammond](https://community.transloadit.com/u/Brian_Hammond)\
**Post date:** [January 26, 2011, 6:38am UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/9 "2011-01-26T06:38:00Z")

</div>

Hey Felix,

The store is using a `use` of `resize`.

AFAIK this means that the `store` step depends on the step.

Any idea what’s going on then?

```auto
[store setObject:@"resize" forKey:@"use"];

```

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [January 26, 2011, 10:38am UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/10 "2011-01-26T10:38:00Z")

</div>

Hi Brian,

the code looks good to me, I’m not sure I understand the problem. Can you explain this differently?

--fg

---

<div class="post-metadata">

**Author:** ![Brian\_Hammond](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/brian_hammond/32/1484_2.png) [@Brian\_Hammond](https://community.transloadit.com/u/Brian_Hammond)\
**Post date:** [January 26, 2011, 5:05pm UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/11 "2011-01-26T17:05:00Z")

</div>

Your suggestion for a fix in post 8 to the problem in post 7 is already a part of post 7.

---

<div class="post-metadata">

**Author:** ![Felix\_Geisendorfer](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/felix_geisendorfer/32/1463_2.png) [@Felix\_Geisendorfer](https://community.transloadit.com/u/Felix_Geisendorfer)\
**Post date:** [January 31, 2011, 10:58am UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/12 "2011-01-31T10:58:00Z")

</div>

Brian: You’re right, I missed that in stanislas’ comment.

However, looking at his assembly, the problem was that there was no file uploaded.

About the ordering: The `"use"` parameter will make sure that the files are processed int he right order, however, it has no effect on how the steps are ordered in the resulting JSON.

What problem are you running into Brian?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex032/uploads/transloadit/original/1X/04ee57da0cb7ac8728a9ac5965c288164f4ce280.svg) [@system](https://community.transloadit.com/u/system)\
**Post date:** [October 7, 2026, 9:05am UTC](https://community.transloadit.com/t/iphone-sdk-sending-params-instead-of-template-id/17822/13 "2026-10-07T09:05:50Z")

</div>


