"Method not allowed" when creating account in node

I'm having issues getting the REST API to allow me to create a new account via node.  I am able to authenticate the session, I can do some research and pull up the files, but whenever I try to create an account I get an error of "Method not allowed."  Does anyone know what I am doing wrong?

var request = require('request');  

var company  = ""; 
var username = "";  
var password = "";  


var authenticationHeader = "Basic " + new Buffer(company + "\\" + username + ":" + password).toString("base64");  
// Authenticate session
request(  
        {  
            "headers" : { "Authorization" : authenticationHeader },  
            "url" : "https://login.eloqua.com/id",  
            "method" : "GET"
        },  
        function (error, response, body) {  
            // Check to make sure that we actually logged in
            console.log("--- Authenticate Session ---------")
            console.log("statusCode: " + response.statusCode)
            console.log(body)

            // Add new account
            var baseURL = JSON.parse(body).urls.base;
            var url = baseURL + "/API/REST/1.0/data/accounts";
            request(  
                    {  
                        "headers" : { "Authorization" : authenticationHeader },
                        "url" : url,
                        "method" : "POST",                        
                        "body" : "name=Company Name&address1=Address 1&address2=Address 2&businessPhone=555.555.5555&city=San Francisco&country=US&postalCode=94105&province=CA"
                    },
                    function (error, response, body) {  
                        console.log("--- Account Added ---------")
                        console.log("statusCode: " + response.statusCode)
                        console.log(body)

                        // List accounts
                        var url = baseURL + "/API/REST/1.0/data/accounts?count=50&page=1";
                        request(  
                                {  
                                    "headers" : { "Authorization" : authenticationHeader },  
                                    "url" : url,  
                                    "method" : "GET"
                                },  
                                function (error, response, body) {  
                                    console.log("--- Account List ---------")
                                    console.log("statusCode: " + response.statusCode)
                                    console.log(body)


                                }
                        );

                    }
            );                        
        }
);

So I had two errors in the code above, was first in line 24, where I had typed accounts instead of the account.

So it should rather read

...
var url = baseURL + "/API/REST/1.0/data/account"...

The second error is with how I created the body on line 30. I have since rewritten this article, lines 25-31 by the following

...
           var requestBody =
           {
               "name": "RR Donnelley",
               "address1": "625 Market Street",
               "address2": "Suite 500",
               "businessPhone": "415.247.7000",
               "city": "San Francisco",
               "country": "US",
               "postalCode": "94105",
               "province": "CA"
           }
           request(
                   {
                       "url" : url,
                       "method" : "POST",
                       "headers" : { "Content-Type": "application/json", "Authorization" : authenticationHeader },
                       "body" : JSON.stringify(requestBody)
                   },
...

Tags: Marketers

Similar Questions

  • [See planner 3.0] Getting HTTPException: 405 method not allowed when connecting to vcenter

    Hello community,

    I'll put up a simple-VM Local View Planner Mode test and I'm following the facility and for the same guide.

    For each operation that requires the Planner view controller device to talk to vcenter, the python I get following error. Therefore, any of the my offices register and no trigger of the workload.

    [root@view-planner-01 ViewPlanner] # python checkconfig.pyc perfcounter vdi-gmi-01

    /root/ViewPlanner/mysql_interface.py:17: DeprecationWarning: the games module is obsolete

    /root/ViewPlanner/PySQLPool/PySQLPool/PySQLConnection.py:6: DeprecationWarning: the md5 module is deprecated; Use the hashlib instead

    Traceback (most recent call changed):

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/checkconfig.py", line 71, < module >

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/checkconfig.py", line 66, hand

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/checkconfig.py", line 24, at the addperfcounter

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/checkconfig.py", line 20, in loadVC

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/vc_interface.py", line 106, in preloadVCInfo

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/pyVmomi/vim/__init__.py", line 45, connect

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/pyVmomi/VmomiSupport.py", line 515, < lambda >

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/pyVmomi/VmomiSupport.py", line 324, _InvokeMethod

    File "/ build/mts/release/bora-1229598/performance/viewplanner/Harness/root/pyVmomi/SoapAdapter.py", line 1162 in InvokeMethod

    httplib. HTTPException: 405 method not allowed

    My viewplanner.log file is also attached.

    I'd appreciate any help to resolve this issue.

    ~ Severe

    seems to me that you give this KB, a glance.

    VMware KB: Diagnose the vSphere Client when it is unable to connect to an ESX/ESXi host or vCenter Server

    Hopefully this will solve your problem

    Best regards

    Yours, Oscar

  • Failed to create application - error 405 method not allowed

    Installed 11.1.2.1. Tried using EPMA deploy abort Getting about with the method not allowed error. I tried using classic and make the same mistake. Some details said "Server error in Application" DEFAULT WEB SITE/HFM ', "cannot be displayed the page you are looking for because an invalid method (HTTP verb) is used." Any thoughts on possible causes?

    Hi Fsotto,

    The document below would settle the matter.
         
    New installation on IIS 7, cannot access error 404.3 of workspace HFM in the IIS logs on the Server Web HFM (Doc ID 1285684.1)

    Hope this helps,

    Please feel free to mark the reply as a useful answer / answer, if you find the relevant useful poster so that it also helps us keep track of queries answered.

    Thank you
    Charles Babu J

  • You are not allowed to create or update this content

    I am trying to create a new post, but when I click on 'Post' I get the error message "you are not allowed to create or update this content.

    Is this a bug or is it user error?

    Try again in a little, it's a known bug. Also try to refresh the page or signing in.

  • "Method not allowed" error on TO vAppTemplate /productSections

    According to the documentation, I should be able to make a /productSections of vAppTemplate

    http://www.VMware.com/support/VCD/doc/rest-API-doc-1.5-HTML/operations/put-ProductSections-vAppTemplate.html

    Operation: Sections of products update of a VAPP model [NEW]
    Request: PUT APIURL/vAppTemplate/vappTemplate-id/productSections
    RequestBody: ProductSectionList
    Response: Task

    This causes a "Method not allowed" error. I do this as a system administrator.

    Well, actually, it seems that the vAppTemplates are immutable.

    This is why you cannot update the section of the product of a model.

    You can try adding this article during the creation of vAppTemplate.

  • Error 405 method not allowed

    I use Dreamweaver 8 (Studio 8) and made a few PHP pages got finally connected to the database and it worked well for two weeks. Then suddenly a few days ago all of a sudden I can't connect to the database in Dreamweaver. I can connect using SQLyog but not Dreamweaver just keep getting a "405 method not allowed error»

    Any ideas?

    I use Dreamweaver 8 (Studio 8) and made a few PHP pages got finally connected to the database and it worked well for two weeks. Then suddenly a few days ago all of a sudden I can't connect to the database in Dreamweaver. I can connect using SQLyog but not Dreamweaver just keep getting a "405 method not allowed error»

    Any ideas?

  • Sorry, this content is not allowed when you try to post in the PL/SQL forum.

    Hello

    Also the command SQL and reserved words, the formulations used by my request.
    about 37 contained lines:

    row_cnt, rec_cnt, disc_amt, item_id, tmp_tot, amount, PMI.

    Am confused as to what word/s was considered at fault.

    can send the contents of any message to the moderator for verification?

    Concerning
    Zack

    Published by: Zack.L on July 25, 2010 17:20

    Ah, I see John "440bx - 11 GR 2" figured out that the word problem was "discount" on the sorry, this content is not allowed when you try to view.. (I replaced the "c" by "& #99;" here to avoid the same fate.)

  • iTunes Song not allowed when I know it's

    I bought an album on iTunes earlier, several months at least and have listened to several times. I know that it is allowed for my computer and my account. But now when I try to play a song the album it says the song is not allowed for this computer. I tried to allow him and he says this computer is allowed, but he will not play again. The rest of the album works fine, it's just a song. What happens here? any suggestions are welcome.

    It is corrupt. Delete and re-download it if this operation is free in your country.

    (140561)

  • Log on to the method not allowed on this computer

    original title: Error Window Vista.

    You cannot connect because the logon method, you use is not allowed on this computer. Please, see your network administrator for more information. This is the response I get when I try to log on my Windows Vista computer on a domain. I removed all the newspapers deny on policies affecting the comments. Always the same. Can anyone help.

    Hello

    I suggest you to ask your question at the following link.

    http://social.technet.Microsoft.com/forums/en-us/w7itpronetworking/

    I would also ask you to contact your IT Department.

  • Windows 7 disk management utility does not allow for creating simple volume: maximum number of partitions exceeded error

    I am trying to create a new partition in Win7 using the disk management utility. Shrank lecteurC existing to create unallocated space. Am not able to create a simple volume with this space unallocated due to the following error message.

    "You cannot create a new volume in this unallocated space because the disk already contains the maximum number of partitions".

    How to fix this or go around with another method to create partitions?

    Hello

    You will need to convert the dynamic disk before creating the extra partition. To do this in disk management:

    -Right-click the disk 0 (gray area) which indicates the total size of your hard drive

    -Select 'convert to dynamic disk.

    Once you have converted to dynamic disk, you will be able to go and create the new simple partition.

    I hope this helps.

    Best regards, Damian

    Damian Coverly

  • When creating collections and nodes via PHP setting is not the storage schema

    Hello!
    I am trying to create cat Collection and nodes with PHP backend.
    I use this setup as the basis for all nodes with small changes:

    static private $CHAT_CONFIGURATION = array(
       'accessModel'=>self::ROLE_VIEWER,
       'publishModel'=>self::ROLE_VIEWER,
       'persistItems'=>true,
       'modifyAnyItem'=>false,
       'userDependentItems'=>false,
       'sessionDependentItems'=>false,
       'itemStorageScheme'=>self::STORAGE_SCHEME_QUEUE,
       'allowPrivateMessages'=>false,
       'lazySubscription'=>false,
       'p2pDataMessaging'=>false
    );
    

    STORAGE_SCHEME_QUEUE = 1
    And this value has changed not for any node of hostory_ *.
    But when the node created I'm trying to use the chat and may not serve more than one value. Then I checked the configuration of the node from room console and found that this storage system has the value ITEM UNIQUE. When I changed it (using the room console) to TAIL cat began to work properly. How to set up the storage system correctly?
    Thank you!

    Well, I still don't know what it is.

    I tried your code and it works fine for me. After you run your 'createSession_chat' on a room newly created, I call getNodeConfiguration on the new nodes and that's what I get:

    -ALL-

    http_get: https://na2.collaboration.adobelivecycle.com:443/app/rtc? path = / chat_1/nodes/history/config print

    10.0 true false 1.0

    -PARTICIPANTS-

    http_get: https://na2.collaboration.adobelivecycle.com:443/app/rtc? quotes/configuration of the path = / chat_1/nodes/history_partic

    10.0 50.0 faux 1.0

    -HOSTS-

    http_get: https://na2.collaboration.adobelivecycle.com:443/app/rtc? path = / chat_1/history_hosts/nodes/configuration

    10.0 100.0 false 1.0

    -TYPING-

    http_get: https://na2.collaboration.adobelivecycle.com:443/app/rtc? ration = / chat_1/nodes/typing/adjustment path

    true 10.0 false 2.0 true

    ItemStorageScheme values match the values you used during the creation of nodes.

    Not sure what disaster happens with the Whiteboard because everything you showed us so far was connected to the nodes of cat, and I guess that I have no intention to proceed with changes to the PHP code since everything seems to work as specified.

  • Error not allowed when searching for historical account provisioned resource

    Hi Experts,

    I put in service an ACF2 IOM 11 GR 2 account, I wanted to check the history of the resource of the configured account. When I clicked on the history button of resource, I get error page say:

    Just for information, I am tired of doing the same SSL also

    Error 401 - non authorized
    RFC 2068 Hypertext Transfer Protocol--HTTP / 1.1:
    * 10.4.2 401 Unauthorized *.
    The request requires user authentication. It MUST contain a header field WWW-Authenticate (section 14.46) containing a fault that is applicable to the requested resource. The client MAY repeat the request with a suitable authorization (section 14.8) header field. If the application already includes identification of the authorization information, then the 401 response indicates that authorization was refused for those credentials. If the 401 response contains the same challenge as the previous answer, and that user agent has already attempted at least once authentication, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include diagnostic information relevant. HTTP access authentication is explained in section 11.

    All the world is facing this problem? Help, please!

    Restart the server of the IOM.
    While restarting clear cache tmp and stage of folder on the server.

    Use xelsysadm to access resource history.

    ACF2 also in service to another user, then check.

  • Sound not record when creating a DVD

    original title: can not make dvd player make a dvd with sound, even if it has the sound in preview mode

    When I use dvd creating the sound comes out in the preview, but not on the disk. I slowed down the record speed, but still no sound after dvd is recorded. What can do

    When I use dvd creating the sound comes out in the preview, but not on the disk. I slowed down the record speed, but still no sound after dvd is recorded. What can do

    ============================================
    The following article might be worth a visit:

    How to burn DVDs with Windows DVD Maker
    http://www.7tutorials.com/how-burn-DVDs-Windows-DVD-Maker
    (scroll waaay down for...) What to do in case of problems)

    If unchecking filters does not improve the issue... it is
    possible that your source files are incompatible or damaged.

  • table/view not found when creating a package, but can execute sql...

    I'm trying to create a package I'm ora-00942 table or view does not exsit, but when I run with the same user tries to create the package in the sql statement that gives NO error through fine.

    Any idea what can cause that?

    -drop table demo_hdr_trgt

    -drop table demo_hdr_stg

    -It's the tabe belong to the other user not my own schema

    connect tstdata/tstdata

    create the table demo_hdr_stg as floor (dbms_random.value (1,101)) select id, floor (dbms_random.value (1001,100001)) double amt connect by level < = 100

    /

    -It's my diagram

    connect me3/me3

    create the table demo_hdr_trgt in select * from hdr_stg where 1 = 0

    /

    Select * from tstdata.demo_hdr_stg by id

    /

    Select * from demo_hdr_trgt by id

    /

    -business for this temporary table to demo rule

    ALTER TABLE demo_hdr_trgt add PRIMARY KEY (id)

    /

    -table to the control of the error for the DML

    Start

    DBMS_ERRLOG. CREATE_ERROR_LOG('tstdata.) DEMO_HDR_STG');

    end

    /

    -Follow-up of the load table if he succeeds

    CREATE TABLE demo_RESULT_TAB

    (VARCHAR2 (100) 'RUN_NAME',)

    VARCHAR2 (100) "V_MODULE."

    VARCHAR2 (100) "V_ACTION."

    NUMBER OF "ROWCOUNT".

    )

    /

    -Follow-up of the other error table

    CREATE TABLE demo_ERROR_TAB

    (VARCHAR2 (100) 'RUN_NAME',)

    VARCHAR2 (100) "V_MODULE."

    VARCHAR2 (100) "V_ACTION."

    NUMBER OF "SQLCODE"

    "SQLERRM' VARCHAR2 (4000).

    "CALL_STACK' CLOB

    )

    /

    -package charge demo

    create or replace package demo_hdr_pkg as

    procedure hdr_ldr (run_name varchar2);

    end demo_hdr_pkg

    /

    create or replace package body demo_hdr_pkg as

    procedure hdr_ldr (run_name varchar2) is

    number of v_sqlcode;

    v_sqlerrm varchar2 (1000);

    v_module varchar2 (100): = "demo_hdr_pkg.hdr_ldr";

    v_action varchar2 (100): = "insert into hdr_trgt";

    number of v_rowcount;

    Start

    DBMS_APPLICATION_INFO.set_module (module_name = > v_module,)

    action_name = > v_action);

    -the sql code that gives ora-00942 errors that I can review independent

    -INSERT / * + append PARALLEL * /.

    INSERT / * + PARALLEL * /.

    IN demo_hdr_trgt, SELECT id, tstdata.demo_hdr_stg amt

    LOG ERRORS IN tstdata. ERR$ (run_name) _demo_HDR_STG

    REJECT LIMIT UNLIMITED;

    v_rowcount: = number of lines sql %;

    INSERT into demo_result_tab (run_name, v_module, v_action, rowcount) values (run_name, v_module, v_action, v_rowcount);

    commit;

    exception when others then

    dbms_output.put_line(SQLCODE||) e '|| SQLERRM);

    v_sqlcode: = sqlcode;

    v_sqlerrm: = sqlerrm;

    insert into demo_error_tab (run_name, v_module, v_action, sqlcode, sqlerrm, call_stack) values (run_name, v_module, v_action, v_sqlcode, v_sqlerrm, dbms_utility.format_call_stack);

    commit;

    -dbms_scheduler to analyze the error table and send e-mail

    end;

    end demo_hdr_pkg

    /

    -test

    declare

    v_runname varchar2 (100): = to_char (sysdate, 'YYYY_MM_DD_HH24_MI_SS');

    Start

    demo_hdr_pkg.hdr_ldr (v_runname);

    end

    /

    Select * from demo_hdr_stg by id

    /

    Select * from demo_hdr_trgt by id

    /

    Select * from demo_error_tab

    /

    Select * from demo_result_tab

    /

    This question is asked almost every day...

    http://martincarstenbach.WordPress.com/2010/05/27/the-difference-between-a-direct-grant-and-a-role-in-PLSQL/

    Summary, you need a DIRECT grant (not through a role), or you could modify the procedure to use the rights of the appellant (the default is rights define).

    See you soon,.

  • USB stick not recognized when creating recovery disc in Windows 8.

    Original title: Recovery Media Creator prblem

    Hello-I have a desktop K430 Lenovo with a 1 to HDD, Win8 64 b, 12 GB of memory. I'm trying to create a recovery disc using a flash drive HP with 32 GB. I bought a 2 GB Tech Universe that should do the job, but the Recovery Media Creator suggest 16 GB.

    I installed USB Flash Drive 32 GB HP which is identified as HPv125w (F): the computer and selected for how to manage the unknown data or take any Action. I formatted the Flash Drive ENF to match my file system. I also chose computer /Devices removable and open as portable devices in the hope that the flash player would be recognized by the Recovery Media Creator, but it didn't happen.

    I run the following command to create a Recovery flash drive:

    Control Panel/All Control Panel Items/Recovery/create a recovery disk/copy the recovery partition from the pc on the recovery drive (I checked this assertion). I clicked NEXT to continue the process.  I was instructed to connect a USB and the reader must be able to contain at least 16 GB. He also said that everything on the disk is deleted. Identity of the flash player (HPv125w (F) does not appear on the page of recovery media and THEN is grayed out. I need help with this problem.  After checking the Microsoft Community, I learned that I could use search from the start page or opening of office and enter recoverydrive.exe and make appear the Recovery Media Creator. I performed this task once again, but I got the same results, as shown above. Thanks in advance.

    Hello-I have a desktop K430 Lenovo with a 1 to HDD, Win8 64 b, 12 GB of memory. I'm trying to create a recovery disk

    Identity of the flash player (HPv125w (F) does not appear on the page of recovery media and THEN is grayed out. I need help with this problem.

    You can also try using diskpart to his list volume control just to compare his view of this device.

    BTW, there is another user of Lenovo, who tries something similar but without keyboard to help...

    http://social.technet.Microsoft.com/forums/IE/en-us/04e45c11-b5c0-48b0-AB58-3f96a1040e40/how-to-restore-Windows-8-from-a-recovery-USB-on-a-Tablet-Wo-physical-keyboard

    I think that it may actually be further ahead than you?    ; )

    Good luck

    Robert Aldwinckle
    ---

Maybe you are looking for

  • I have problems with my phone

    I Got a new phone, it worked sincerar Wong first day I got it. I back to the store and it is saying it's ok the Kost then crash or Get freesen applications all the time. I can't send a photo in whataap of the application for a few weeks. I have to ta

  • W500 Bluetooth poor Audio quality

    Hi all I recently bought a Bose Soundlink speaker bluetooth and have paired with my ipod touch and w500. IPod Touch sounds good, but the audio through the speaker to come via the w500 looks like it's cut, especially at the fort-normal listening level

  • Problems with sound: XP Pro, SP3

    Hello experts: I'm at my wits end. I can't get my sound to work after a charging system. I did this: -Re-partitioned, formatted my hard drive.  Loading XP Pro, SP3. Had no problems. -Loading the appropriate drivers, including AC 97 Audio Realtek and

  • request quote

    Ciao,. Ho need quote by sku 3JR9. He TSR this ha rimandato a voi by quotazione. 5s vostre Grazie thousand Davide

  • DV9500T CTO QUICKPLAY BUTTON MUTE WORKS BUT NOT WILL SWITCH COLORS - BLUE STAYS ALL THE TIME

    I've upgraded to Windows 7 and everything works except the change color button mute of QuickPlay.  It remains blue all the time EXCEPT at startup when it becomes red or orange, then back to blue. He cut the sound, but in low light conditions, it's fr