Forum Discussion

API_User's avatar
API_User
Equinix Employee
5 years ago

Work Visit API - issue EQX-161-403

Hey there, I need help!

I tried to use API and create a POST REST API request to raise a Work Visit request to Equinix. but unfortunately returned the EQX-161-403 errors. Please kindly help, no idea what this error message means and how to fix this error.

Here's the error message from my PowerShell script:

$workvisit = invoke-restmethod -uri "https://api.equinix.com/v1/orders/workvisit" -method POST -Headers $postParams -body $postParamsWVJson -ContentType "application/json"
invoke-restmethod : {"errors":[{"code":"EQX-161-403","message":"Contacts (with userName) should be Active and Approved"}],"ticketId":"201030030XXXXXX"}


Here's my PowerShell script:

$postParams = @{}
$postParams.Authorization="Bearer " + $token.access_token
$location = invoke-restmethod -uri "https://api.equinix.com/v1/orders/workvisit/locations" -method GET -Headers $postParams -ContentType "application/json"
$location2= invoke-restmethod -uri "https://api.equinix.com/v1/retrieve-orders/locations" -method GET -Headers $postParams -ContentType "application/json"

$postParamsWV = `
@{"contacts" =
@(
@{"contactType"="ORDERING";
"userName" = "XXXX@YYY.com"};
@{"contactType"="NOTIFICATION";
"userName" = "XXXX@YYY.com"};
);

"ibxLocation"=
@{"ibx" = "SAMPLE";
"cages"=
@(
@{"cage"="SAMPLE:00:000000";
"accountNumber" = "SAMPLE NUMBER"}
)};


"serviceDetails" =
@{schedule =
@{startDateTime = "2020-05-10T01:00:00Z";
endDateTime = "2020-05-11T02:00:00Z"
};

"visitors" =@(@{"firstName" = "John";
"lastName" = "Doe";
"company" = "NN Test";
"email" = "John.Doe@Test.com";
"mobilePhoneCountryCode" = "+81";
"mobilePhone" = "80-1111-2222";};
@{ "userName" = "DDDD@yahoo.com"}
);
escortRequired = $false;
openCabinet = $false;
}
}
$postParamsWVJson = $postParamsWV|convertto-json -depth 100
$workvisit = invoke-restmethod -uri "https://api.equinix.com/v1/orders/workvisit" -method POST -Headers $postParams -body $postParamsWVJson -ContentType "application/json"

Regards,
Alan

  • Hello Alan,

    As you're getting an EQX-161-403, could you please check if you're passing the correct username for your ordering and notification contact?

    In this case, XXXX@YYY.com must match the username shown in the ECP portal. If you're unaware of how to search and identify a username in ECP portal, please reach out to your master admin or CSM.

    - Equinix Developer Community

  • API_User's avatar
    API_User
    Equinix Employee

    Hello Alan,

    As you're getting an EQX-161-403, could you please check if you're passing the correct username for your ordering and notification contact?

    In this case, XXXX@YYY.com must match the username shown in the ECP portal. If you're unaware of how to search and identify a username in ECP portal, please reach out to your master admin or CSM.

    - Equinix Developer Community