Skip to main content
Participant
Nov 13, 2023 5:56 PM UTC
Answered

https://pdf-services-ue1.adobe.io/assets generating forbidden error 403 invalid client id

we have created credentials (server to server authentication) as  per te documentation and generated access token using rest api.

When trying to  generate upload presigned URI using rest api https://pdf-services-ue1.adobe.io/assets  using api key  generated in credentials we are getting forbidden error  http errocode 403 (error code: 403003) Clientid Id is invalid 

    This topic is closed to new replies. Start a new post to keep the conversation going.
    ajay gunjalCorrect answer
    Participant
    Nov 15, 2023 4:28 AM UTC

    Your second auth header is wrong. It isn't X-API-KeyRequired, but X-API-Key.


    issue is resolved thank you very much

    4 replies

    Raymond Camden
    Community Manager
    Community Manager
    Nov 13, 2023 8:39 PM UTC

    Can you share some code showing how you are calling the API?

    Translate
    Participant
    Nov 14, 2023 5:09 AM UTC

    the bove code in c++ using microsoft c++rest sdk

    std::string CWbssecurity::Adobeassetuploadid(std::string accesstoken, std::string clientid, std::string requestid)
    {
    std::shared_ptr<std::string> rtn = std::shared_ptr<std::string>(new std::string());

    try
    {

    std::string otpuri = "https://pdf-services.adobe.io/assets";


    utility::string_t otpuris = utility::conversions::to_string_t(otpuri);


    web::uri uri(utility::conversions::to_string_t(otpuris));
    web::uri_builder uri_builder(uri);
    web::http::client::http_client client(uri);
    web::http::http_request request2(web::http::methods::POST);

    std::string contype = "application/json";
    utility::string_t ctype = utility::conversions::to_string_t(contype);

    request2.headers().set_content_type(ctype);

    std::string auth = "Authorization";
    utility::string_t autht = utility::conversions::to_string_t(auth);
    std::string bearer = "Bearer " + accesstoken;
    request2.headers().add(autht, bearer.c_str());


    std::string apikey = "X-API-KeyRequired";
    utility::string_t apikeys = utility::conversions::to_string_t(apikey);
    request2.headers().add(apikeys, clientid.c_str());

     

    std::string payload;
    payload = "{\"mediatype\": \"application/pdf\"}";

    utility::string_t body = utility::conversions::to_string_t(payload);


    request2.set_body(body);
    client.request(request2).then([rtn](web::http::http_response response2)
    {

    *rtn = utility::conversions::to_utf8string(response2.extract_string(true).get());


    CString msg;
    msg.Format(_T("St: %d"), response2.status_code());
    AfxMessageBox((CString)rtn->c_str() + msg);

     

    }).wait();
    }
    catch (web::http::http_exception e)
    {
    AfxMessageBox((CString)(e.what()));
    }
    return(*rtn);
    }

    Translate
    Raymond Camden
    Community Manager
    Community Manager
    Nov 14, 2023 2:14 PM UTC

    Your second auth header is wrong. It isn't X-API-KeyRequired, but X-API-Key.

    Translate