Expand my Community achievements bar.

SOLVED

Failed with status 400 creating new room.

Avatar

Level 3

Hi,

I am using the server API to create a new room, but I fail with a response code of 400. Can you tell me what I am doing wrong?

I'm using the sample Java server integration code to do this.

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Employee

So, here is the deal: The structure of templates and rooms is actually flat. For each account there is a list of templates that can be used and a list of rooms that have been created either from the default template or one of the templates in your list.

Applications are just a logical way to group rooms created from a specific template (and then apply the same limits to rooms in the same "application").

When you create an "application" you create a template named as the application. When you create a room inside an application you are actually creating a room using the "application" template.

In your particular case you may be confusing rooms and template, because what I really see is:

- The account is named "xoomxo"

-- There is an application named "xoomxo" (so there is a template named "xoomxo")

--- The "xoomxo" application contains a ROOM named "dateroomtemplate" (and I am guess you really don't have a template called "dateroomtemplate").

So, what you need to do is either create a template based on the room "dateroomtemplate" (and you can call it "dateroomtemplate" since templates are stored in a different place than room), or you re-create your "xoomxo" application based on the "dateroomtemplate" room, but then you need to use "xoomxo" as your room template.

I hope this help, and if you think all this is confusing, blame Nigel , that invented this "fake" hierarchy on top of a flat structure.

View solution in original post

7 Replies

Avatar

Employee

Are you logging in as the account owner ? (your developer credential).

If you can enable debugging and send the trace it would be helpful. Or you should at least send me your account URL and I can look in our logs.

Avatar

Level 3

Thanks Raff,

Yes, I am using the account owner credentials to log in. I will send you the account information in a private message.

Avatar

Level 3

Hi Raff,

Here are the logs when I set Utils.DEBUG = true;

http_get: http://connectnow.acrobat.com/xoomxo?mode=xml&accountonly=true&;

{}

Redirecting to https://na2.connectnow.acrobat.com/xoomxo?mode=xml&accountonly=true&;

http_get: https://na2.connectnow.acrobat.com/xoomxo?mode=xml&accountonly=true&;

{}

Content-Type: text/xml;charset=UTF-8

Content-Length: 177

http_post: https://services.acrobat.com/account/wsapi/auth/v1 <request><username>xoomxo@gmail.com</username><password>bizzybaz1</password></request>

{Content-Type=text/xml}

Content-Type: text/xml;charset=UTF-8

Content-Length: 127

http_get: https://na2.connectnow.acrobat.com:443/xoomxo?mode=xml&accountonly=true&gak=cmVuZ2EqbmExcioxMjcwYzUw...

{}

Content-Type: text/xml;charset=UTF-8

Content-Length: 323

http_post: https://na2.connectnow.acrobat.com:443/xoomxo mode=xml&room=xoomxoroom2.15_Room&template=dateroomtemplate&gak=cmVuZ2EqbmExcioxMjcwYzUwMDgyMipFQ1E5WjdHMkpENUE1NDlLUFpDUVA4UU1OUg==

{}

HTTP error 400

Does this show what might be causing the error?
Thanks,
Barry

Avatar

Employee

The real error is "bad template" (and I'll work on making errors more explanatory)

Looks like you don't have a template called "dateroomtemplate" in your account.

Did you verify with DevPortal that the template exists ? (or you can call AccountManager.listTemplates from the same script where you call createRoom)

-- Raffaele

Avatar

Level 3

Thanks Raff,

I think the problem may be that the template I am trying to use is created under an application and NOT the default application.

When I list the templates it seems to list the application I created under the account and NOT the templates under the application. I tried adding my application to the connection URL but this didn't change anything and I don't see an example for this on AFCS.java.

I'll attach a screenshot of my room console, but it looks to me like I am a connecting to a node higher than where the template I am referencing resides in my account.

How do I tell the AccountManager to drill down to the next level?

RoomConsole.jpg

Thanks,

Barry

Avatar

Correct answer by
Employee

So, here is the deal: The structure of templates and rooms is actually flat. For each account there is a list of templates that can be used and a list of rooms that have been created either from the default template or one of the templates in your list.

Applications are just a logical way to group rooms created from a specific template (and then apply the same limits to rooms in the same "application").

When you create an "application" you create a template named as the application. When you create a room inside an application you are actually creating a room using the "application" template.

In your particular case you may be confusing rooms and template, because what I really see is:

- The account is named "xoomxo"

-- There is an application named "xoomxo" (so there is a template named "xoomxo")

--- The "xoomxo" application contains a ROOM named "dateroomtemplate" (and I am guess you really don't have a template called "dateroomtemplate").

So, what you need to do is either create a template based on the room "dateroomtemplate" (and you can call it "dateroomtemplate" since templates are stored in a different place than room), or you re-create your "xoomxo" application based on the "dateroomtemplate" room, but then you need to use "xoomxo" as your room template.

I hope this help, and if you think all this is confusing, blame Nigel , that invented this "fake" hierarchy on top of a flat structure.

Avatar

Level 3

Hi Raff,

That explanation solved my problem. The hierarchy is a little bit confusing but I see how it works now.

Thanks,

Barry